version 11 (Modified)
SCREEN DEPTH (depth; color{; screen})
Parameter | Type | Description | |
depth | Number | Depth of the screen | |
(number of colors = 2 ^ depth) | |||
color | Number | 1 = Color screen, 0 = Black and white or Gray scale | |
screen | Number | Screen number, or main screen if omitted |
Description
The Screen depth command returns in depth and color information about the monitor.
After the call:
The depth of the screen is returned in depth. The depth of the screen is the exponent of the power of 2 expressing the number of colors displayed on your monitor. For example, if your monitor is set for 256 colors (2^8), the depth of your screen is 8.
The following predefined constants are provided by 4D:
Constant | Type | Value |
Black and white | Long Integer | 0 |
Four colors | Long Integer | 2 |
Sixteen colors | Long Integer | 4 |
Two fifty six colors | Long Integer | 8 |
Thousands of colors | Long Integer | 16 |
Millions of colors 24 bit | Long Integer | 24 |
Millions of colors 32 bit | Long Integer | 32 |
If the monitor is set to display in color, 1 is returned in color. If the monitor is set to display in gray scale, 0 is returned in color. Note that this value is significant on the Macintosh platform.
The following predefined constants are provided by 4D:
Constant | Type | Value |
Is gray scale | Long Integer | 0 |
Is color | Long Integer | 1 |
The optional parameter screen specifies the monitor for which you want to get information. If you omit the screen parameter, the command returns the depth of the main screen.
Example
Your application displays many color graphics. Somewhere in your database, you could write:
SCREEN DEPTH ($vlDepth;$vlColor) If ($vlDepth<8) ALERT("The forms will look better if the monitor"+" was set to display 256 colors or more.") End if
See Also
Count screens, SET SCREEN DEPTH.