SetPaletteEntries function (wingdi.h)

The SetPaletteEntries function sets RGB (red, green, blue) color values and flags in a range of entries in a logical palette.

Syntax

UINT SetPaletteEntries(
  [in] HPALETTE           hpal,
  [in] UINT               iStart,
  [in] UINT               cEntries,
  [in] const PALETTEENTRY *pPalEntries
);

Parameters

[in] hpal

A handle to the logical palette.

[in] iStart

The first logical-palette entry to be set.

[in] cEntries

The number of logical-palette entries to be set.

[in] pPalEntries

A pointer to the first member of an array of PALETTEENTRY structures containing the RGB values and flags.

Return value

If the function succeeds, the return value is the number of entries that were set in the logical palette.

If the function fails, the return value is zero.

Remarks

An application can determine whether a device supports palette operations by calling the GetDeviceCaps function and specifying the RASTERCAPS constant.

Even if a logical palette has been selected and realized, changes to the palette do not affect the physical palette in the surface. RealizePalette must be called again to set the new logical palette into the surface.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

Color Functions

Colors Overview

GetDeviceCaps

GetPaletteEntries

PALETTEENTRY

RealizePalette