EngCreatePalette (Compact 2013)
3/26/2014
This function sends a request to GDI to create a palette.
Syntax
HPALETTE EngCreatePalette(
ULONG iMode,
ULONG cColors,
ULONG* pulColors,
FLONG flRed,
FLONG flGreen,
FLONG flBlue
);
Parameters
iMode
[in] Value that specifies how to define the palette.The following table shows possible values for this parameter.
Value
Description
PAL_BITFIELDS
The values of the flRed, flGreen, and flBlue parameters define the palette.
PAL_BGR
The device accepts RGB colors directly, with blue as the least significant byte.
PAL_CMYK
The device accepts CMYK colors directly, with cyan as the least significant byte.
PAL_INDEXED
The values of the cColors and pulColors parameters provide an array of RGB colors.
PAL_RGB
The device accepts RGB colors directly, with red as the least significant byte.
- cColors
[in] If the value of the iMode parameter is PAL_INDEXED, number of colors provided in the array pointed to by the pulColors parameters. Otherwise, set this parameter to zero.
- pulColors
[in]If the value of the iMode parameter is PAL_INDEXED, pointer to the beginning of an array of ULONG values. The low-order 3 bytes of each ULONG define the RGB colors in the palette.
- flRed
[in] If the value of the iMode parameter is PAL_BITFIELDS, mask that shows which bits correspond to red. Each mask must consist of contiguous bits and should not overlap other masks. GDI supports all combinations of bitfields.
- flGreen
[in] If the value of the iMode parameter is PAL_BITFIELDS, mask that shows which bits correspond to green. Each mask must consist of contiguous bits and should not overlap other masks. GDI supports all combinations of bitfields.
- flBlue
[in] If the value of the iMode parameter is PAL_BITFIELDS, mask that shows which bits correspond to blue. Each mask must consist of contiguous bits and should not overlap other masks. GDI supports all combinations of bitfields.
Return Value
This function returns a handle to the new palette if the function call succeeds. Otherwise, the function returns zero and logs an error code.
Remarks
The driver can associate the new palette with a device by returning a pointer to the palette in the DEVINFO structure.
A PAL_INDEXED palette associated with the device must have its first index entry set to black and its last entry set to white. Set the colors for other entries so that the color of each entry contrasts greatly with the color of its complementary index. For example, if you set entry 0x9 of a 16-entry palette to green, set entry 0x6 to a color that contrasts with green, such as purple. If you set colors of entries in this way, XOR raster operations behave reasonably.
Requirements
Header |
winddi.h |
Library |
Ddi_ati_lib.lib, |