GetPaletteEntries function

The GetPaletteEntries function retrieves a specified range of palette entries from the given logical palette.

Syntax

UINT GetPaletteEntries(
  HPALETTE       hpal,
  UINT           iStart,
  UINT           cEntries,
  LPPALETTEENTRY pPalEntries
);

Parameters

hpal

A handle to the logical palette.

iStart

The first entry in the logical palette to be retrieved.

cEntries

The number of entries in the logical palette to be retrieved.

pPalEntries

A pointer to an array of PALETTEENTRY structures to receive the palette entries. The array must contain at least as many structures as specified by the nEntries parameter.

Return Value

If the function succeeds and the handle to the logical palette is a valid pointer (not NULL), the return value is the number of entries retrieved from the logical palette. If the function succeeds and handle to the logical palette is NULL, the return value is the number of entries in the given 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.

If the nEntries parameter specifies more entries than exist in the palette, the remaining members of the PALETTEENTRY structure are not altered.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] 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

GetSystemPaletteEntries

PALETTEENTRY

SetPaletteEntries