OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Extending TPalette

TPalette contains two protected-access functions, both called TPalette::Create.

The two functions differ in that one takes BITMAPINFO * as its first parameter and the other takes a BITMAPCOREINFO * as its first parameter. These functions are called from the TPalette constructors that take a BITMAPINFO *, a BITMAPCOREINFO *, or a TDib &. The BITMAPINFO * and BITMAPCOREINFO * constructors call the corresponding Create functions. The TDib & constructor extracts a BITMAPCOREINFO * or a BITMAPINFO * from its TDib object and calls the appropriate Create function.

Both Create functions take a uint for their second parameter. This parameter is equivalent to the peFlags member of the PALETTEENTRY structure and should be passed either as a 0 or with values compatible with peFlags: PC_EXPLICIT, PC_NOCOLLAPSE, and PC_RESERVED. A palette entry must have the PC_RESERVED flag set to use that entry with the AnimatePalette function.

The Create functions create a LOGPALETTE using the color table from the bitmap header passed as its parameter. You can use Create for 2-, 16-, and 256-color bitmaps. It fails for all other types, including 24-bit DIBs. It then uses the LOGPALETTE to create the HPALETTE.

See Also