Important: The information in this document is obsolete and should not be used for new development.
GetCTable
To get a color table stored in a'clut'
resource, use theGetCTable
function.
FUNCTION GetCTable (ctID: Integer): CTabHandle;
ctID
- The resource ID of a
'clut'
resource.DESCRIPTION
For the color table defined in the'clut'
resource that you specify in thectID
parameter, theGetCTable
function returns a handle to aColorTable
record. If the'clut'
resource with that ID is not found,GetCTable
returnsNIL
.If you place this handle in the
pmTable
field of aPixMap
record, you should first use theDisposeCTable
procedure to dispose of the handle already there.If you modify a
ColorTable
record, you should invalidate it by changing itsctSeed
field. An easy way to do this is with theCTabChanged
procedure, described on page 4-88.The
GetCTable
function recognizes a number of standard'clut'
resource IDs. You can obtain the default grayscale color table for a given pixel depth by callingGetCTable
, adding 32 (decimal) to the pixel depth, and passing this value in thectID
parameter, as shown in Table 4-5.
For full color, you can obtain the default color tables by adding 64 to the pixel depth and passing this in the
ctID
parameter, as shown in Table 4-6. These default color tables are illustrated in Plate 1 at the front of this book.
SPECIAL CONSIDERATIONS
TheGetCTable
function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.SEE ALSO
The'clut'
resource is described on page 4-94.