13.07.2015 Views

REFERENCE GUIDE

REFERENCE GUIDE

REFERENCE GUIDE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Getsystem PaletteUseRealizePaletteSelect PalettesetPaletteEntriessetsystemPaletteUseUpdateColorsDetermines whether an application hasaccess to the full system palette.Maps entries in a logical palette to thesystem palette.Selects a logical palette into a devicecontext.Sets new palette entries in a logical palette;Windows does not map the new entries tothe system palette until the applicationrealizes the logical palette.Allows an application to use the fullsystem palette.Performs a pixel-by-pixel translation ofeach pixel's current color to the systempalette. This allows an inactive window tocorrect its colors without redrawing itsclient area.How colorpalettes workColor palettes provide a device-independent method for accessingthe color capabilities of a display device by managing the device'sphysical (or system) palette, if one is available. Typically, devicesthat can display at least 256 colors use a physical palette.An application employs the system palette by creating and usingone or more logical palettes. Each entry in the palette contains aspecific color. Then, instead of specifying an explicit value for acolor when performing graphics operations, the applicationindicates which color is to be displayed by supplying an indexinto its logical palette.Since more than one application can use logical palettes, it ispossible that the total number of colors requested for display canexceed the capacity of the display device. Windows acts as amediator among these applications.When a window requests that its logical palette be given itsrequested colors (a process known as realizing its palette),Windows first exactly matches entries in the logical palette tocurrent entries in the system palette.If an exact match for a given logical-palette entry is not possible,Windows sets the entry in the logical palette into an unused entryin the system palette.Finally, when all entries in the system palette have been used,Windows takes these logical palette entries that do not exactlymatch and matches them as closely as possible to entries already96Software development kit

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!