DrvSetPalette function

The DrvSetPalette function requests that the driver realize the palette for a specified device.

Syntax


BOOL DrvSetPalette(
  DHPDEV  dhpdev,
  PALOBJ  *ppalo,
  FLONG   fl,
  __range iStart,
  __range cColors
);

Parameters

dhpdev

Handle to the physical device's PDEV structure, which identifies the device whose palette is to be realized. This parameter is the device handle returned to GDI by DrvEnablePDEV.

ppalo

Pointer to the PALOBJ structure from which the colors (RGB values) should be queried.

fl

A set of flags that provides hints and options. This parameter can be the following value:

ValueMeaning

SP_DEFAULT

The palette is the device's complete default palette. The PALOBJ can be ignored, but contains the correct contents.

 

iStart

Specifies the first palette index to overwrite.

cColors

Specifies the number of colors to change in the hardware palette. Extra colors, beyond the number available in the hardware, can be ignored. If cColors is smaller than the size of the hardware palette, set only cColors entries and leave the remaining colors as they are.

Return value

The return value is TRUE if the function is successful. Otherwise, it is FALSE, and an error code is logged.

Remarks

The driver sets the hardware palette to match the entries in the given palette as closely as possible.

Only indexed palettes are realizeable. The RC_PALETTE bit of the flRasterCaps member of the GDIINFO structure specifies whether a device has a realizeable palette.

DrvSetPalette is required for display drivers that support realizeable palettes.

Requirements

Target platform

Desktop

Header

Winddi.h (include Winddi.h)

See also

DrvEnablePDEV
EngCreatePalette
EngDeletePalette

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft