SCREEN DEPTH

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0


SCREEN DEPTH (depth; color{; screen})

ParameterTypeDescription
depthNumberDepth of the screen
(number of colors = 2 ^ depth)
colorNumber1 = Color screen, 0 = Black and white or Gray scale
screenNumberScreen 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 4th Dimension:

ConstantTypeValue
Black and whiteLong Integer0
Four colorsLong Integer2
Sixteen colorsLong Integer4
Two fifty six colorsLong Integer8
Thousands of colorsLong Integer16
Millions of colors 24 bitLong Integer24
Millions of colors 32 bitLong Integer32

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 4th Dimension:

ConstantTypeValue
Is gray scaleLong Integer0
Is colorLong Integer1

The optional parameter screen specifies the monitor for which you want to get information. On Windows, you will not usually pass the screen parameter. On Macintosh, if you omit the screen parameter, the command returns the depth of the main screen, the screen where the menu bar is displayed.

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.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next