Important: The information in this document is obsolete and should not be used for new development.
GetCTableTo get a color table stored in a
'clut'resource, use the
FUNCTION GetCTable (ctID: Integer): CTabHandle;
- The resource ID of a
DESCRIPTIONFor the color table defined in the
'clut'resource that you specify in the
GetCTablefunction returns a handle to a
ColorTablerecord. If the
'clut'resource with that ID is not found,
If you place this handle in the
pmTablefield of a
PixMaprecord, you should first use the
DisposeCTableprocedure to dispose of the handle already there.
If you modify a
ColorTablerecord, you should invalidate it by changing its
ctSeedfield. An easy way to do this is with the
CTabChangedprocedure, described on page 4-88.
GetCTablefunction recognizes a number of standard
'clut'resource IDs. You can obtain the default grayscale color table for a given pixel depth by calling
GetCTable, adding 32 (decimal) to the pixel depth, and passing this value in the
ctIDparameter, as shown in Table 4-5.
Table 4-5 The default color tables for grayscale graphics devices Pixel depth Resource ID Color table composition 1 33 Black, white 2 34 Black, 33% gray, 66% gray, white 4 36 Black, 14 shades of gray, white 8 40 Black, 254 shades of gray, white
For full color, you can obtain the default color tables by adding 64 to the pixel depth and passing this in the
ctIDparameter, as shown in Table 4-6. These default color tables are illustrated in Plate 1 at the front of this book.
Table 4-6 The default color tables for color graphics devices Pixel depth Resource ID Color table composition 2 66 Black, 50% gray, highlight color, white 4 68 Black, 14 colors including the highlight color, white 8 72 Black, 254 colors including the highlight color, white
GetCTablefunction may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.
'clut'resource is described on page 4-94.