Applications can use GpiCreatePalette to change the physical color palette by creating a new palette. This function is used if the application has specific color needs and must ensure that the color is part of the physical color palette. GpiCreatePalette also enables an application to prevent dithering of the 16 default colors by setting the flag parameter to LCOL_PURECOLOR. If the full 256 colors in the palette are needed, the application can set the flag to LCOL_OVERRIDE_DEFAULT_COLORS. It is recommended that the palette manager functions be used only when really necessary because the operating system cannot guarantee consistent colors in other windows and the ability to change the physical palette is device dependent.

After the palette is created, an application can set or change any of the values in the palette by calling GpiSetPaletteEntries. To delete the palette, applications use GpiDeletePalette, passing the handle of the palette to be deleted. (The handle is returned by GpiCreatePalette when the palette is created.)

GpiQueryPalette enables applications to determine the palette currently selected for a given presentation space. A palette can be used by more than one presentation space at the same time. The operating system maintains a count of the number of presentation spaces using a specific palette. Complete information on the current palette can be accessed by GpiQueryPaletteInfo.

Palettes also can be shared by using a palette handle.

When coding an application, color table functions and color palette functions must not be mixed. The application can call DevQueryCaps to determine whether the hardware supports palettes, then call the appropriate functions.


[Back] [Next]