Share via


XLATEOBJ_cGetPalette (Compact 2013)

3/26/2014

This function retrieves colors from a specified palette or the bitfields format of the palette.

Syntax

ULONG XLATEOBJ_cGetPalette(
  XLATEOBJ* pxlo,
  ULONG iPal,
  ULONG cPal,
  ULONG* pPal
);

Parameters

  • pxlo
    [in] Pointer to the XLATEOBJ structure from which GDI retrieves the requested information.
  • iPal
    [in] Palette information to write.

    The following table shows possible values for this parameter.

    Value

    Description

    XO_DESTBITFIELDS

    GDI retrieves the bitfields format of the destination palette.

    XO_DESTPALETTE

    GDI retrieves colors from the destination palette.

    XO_SRCBITFIELDS

    GDI retrieves the bitfields format of the source palette.

    XO_SRCPALETTE

    GDI retrieves colors from the source palette.

  • cPal
    [in] Number of entries in the buffer pointed to by the pPal parameter. The number of entries can be smaller than the size of the palette.
  • pPal
    [out] Pointer to a buffer in which GDI writes the requested palette information.

    If the value of the iPal parameter is XO_SRCPALETTE or XO_DESTPALETTE and the palette type is PAL_INDEXED, each entry in the buffer is a 24-bit RGB value.

    If the value of the iPal parameter is XO_SRCBITFIELDS or XO_DESTBITFIELDS and the palette type is PAL_BITFIELDS, PAL_RGB, or PAL_BGR, the pPal parameter points to three ULONG masks that represent red, green, and blue color masks.

Return Value

If the value of the pPal parameter is not NULL, this function returns the number of entries written. This function returns zero if XLATEOBJ is NULL or the palette is not valid.

This function also returns zero if the data pointed to by the pxlo parameter is not consistent with the value of the iPal parameter. For example, if the data pointed to by the pxlo parameter is a bitfield and the iPal parameter is set to XO_SRCPALETTE or XO_DESTPALETTE, this function returns zero. Similarly, if the data pointed to by the pxlo parameter is a palette and the iPal parameter is set to XO_SRCBITFIELDS or XO_DESTBITFIELDS, this function returns zero.

Remarks

The driver must have information about the palette to perform methods of color blending.

Requirements

Header

winddi.h

Library

Ddi_ati_lib.lib,
Ddi_flat_lib.lib,
Ddi_gx_lib.lib,
Ddi_mq200_lib.lib,
Ddi_nop_lib.lib,
Ddi_rflat_lib.lib,
Ddi_rgx_lib.lib,
Ddi_tvia5_lib.lib

See Also

Reference

GDI Functions for Display Drivers
XLATEOBJ