UINT SetPaletteEntries(hpal, iStart, cEntries, lppe) | |||||
HPALETTE hpal; | /* handle of palette | */ | |||
UINT iStart; | /* index of first entry to set | */ | |||
UINT cEntries; | /* number of entries to set | */ | |||
CONST PALETTEENTRY *lppe; | /* address of array of structures | */ |
The SetPaletteEntries function sets RGB color values and flags in a range of entries in a logical palette.
hpal
Identifies the logical palette.
iStart
Specifies the first logical-palette entry to be set.
cEntries
Specifies the number of logical-palette entries to be set.
lppe
Points to the first member of an array of PALETTEENTRY structures containing the RGB values and flags. The PALETTEENTRY structure has the following form:
typedef struct tagPALETTEENTRY { /* pe */
BYTE peRed;
BYTE peGreen;
BYTE peBlue;
BYTE peFlags;
} PALETTEENTRY;
The return value is the number of entries that were set in the logical palette if the function was successful. Otherwise it is zero.
Even if a logical palette has been selected and realized, changes to the palette will not affect the physical palette in the surface. RealizePalette must be called again to set the new logical palette into the surface.
PALETTEENTRY, RealizePalette