Microsoft Windows CE 3.0  

RealizePalette

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function maps palette entries from the current logical palette to the system palette.

UNIT RealizePalette( HDC
hdc
);

Parameters

hdc
[in] Handle to the device context (DC) into which a logical palette has been selected.

Return Values

The number of entries in the logical palette mapped to the system palette indicates success. GDI_ERROR indicates failure. To get extended error information, call GetLastError.

Remarks

RealizePalettefails if the device associated with hdcdoes not have a settable palette. Call the GetDeviceCapsfunction, specifying the RASTERCAPS constant, to determine if the device has a settable palette before calling RealizePalette.

RealizePalettemodifies the palette for the device associated with the specified device context. If the device context is a memory DC, the color table for the bitmap selected into the DC is modified. If the device context is a display DC, the physical palette for that device is modified.

A logical color palette is a buffer between color-intensive applications and the system, allowing these applications to use as many colors as needed without interfering with colors displayed by other windows.

When an application's window has the focus and it calls RealizePalette, the system attempts to realize as many of the requested colors as possible. The same is also true for applications with inactive windows.

Windows CE does not arbitrate between the palettes of the background and foreground applications. The foreground application has complete control of the system palette. Therefore, Windows CE does not perform any color matching operations for foreground applications; it simply overwrites the system palette entries with the hdcparameter's palette entries .

Windows CE does not support RealizePalettefor background applications.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Wingdi.h   Mgpal.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

GetDeviceCaps, GetLastError, SelectPalette