Creates an 8-bit palette used for halftoning images.
HPALETTE WinGCreateHalftonePalette(void)
Return Value
Returns the handle of a logical palette containing the colors of the WinG halftone palette palette if successful. Otherwise, WinGCreateHalftonePalette returns 0.
Comments
The halftone palette should be selected into any DC into which the application will use WinG to halftone.
The WinG halftone palette is an identity palette: the logical palette indices and physical device indices are the same.
The halftone palette inverts correctly, so bitwise XORs invert colors properly.
See the Using an Identity Palette article for a discussion of identity palettes.
Maximizing Performance
Call WinGCreateHalftonePalette once at the beginning of your application. Select and realize the palette on WM_QUERYNEWPALETTE, WM_PALETTECHANGED, and WM_PAINT messages.
Example
The HALFTONE sample application (in the SAMPLES\CUBE directory of the WinG Development Kit) uses the halftone palette to dither 24-bit images to 8-bits using an 8x8 ordered dither.
See Also
WinGCreateHalftoneBrush WinGStretchBlt WinGBitBlt RealizePalette WM_QUERYNEWPALETTE WM_PALETTECHANGED Halftoning With WinG Using an Identity Palette Code Samples