Important: The information in this document is obsolete and should not be used for new development.
HasDepthTo determine whether a video device supports a specific pixel depth, you can use the
FUNCTION HasDepth (aDevice: GDHandle; depth: Integer; whichFlags: Integer; flags: Integer): Integer;
- A handle to the
GDevicerecord of the video device.
- The pixel depth for which you're testing.
gdDevTypeconstant, which represents a bit in the
gdFlagsfield of the
GDevicerecord. (If this bit is set to 0 in the
GDevicerecord, the video device is black and white; if the bit is set to 1, the device supports color.)
- The value 0 or 1. If you pass 0 in this parameter, the
HasDepthfunction tests whether the video device is black and white; if you pass 1 in this parameter,
HasDepthtests whether the video device supports color.
HasDepthfunction checks whether the video device you specify in the
aDeviceparameter supports the pixel depth you specify in the
depthparameter, and whether the device is black and white or color, whichever you specify in the
HasDepthfunction returns 0 if the device does not support the depth you specify in the
depthparameter or the display mode you specify in the
Any other value indicates that the device supports the specified depth and display mode. The function result contains the mode ID that QuickDraw passes to the video driver to set its pixel depth and to specify color or black and white. You can pass this mode ID in the
depthparameter for the
SetDepthfunction (described next) to set the graphics device to the pixel depth and display mode for which you tested.
HasDepthfunction may move or purge blocks of memory in the application heap. Your application should not call this function at interrupt time.
SEE ALSOSee Designing Cards and Drivers for the Macintosh Family, third edition, for more information about the device modes returned as a function result for