MCI_SETIMAGEPALETTE
Appearance
This message sets the palette or color map to be used for images loaded with subsequent MCI_SETIMAGEBUFFER messages. It applies only to palettized images.
Syntax
param1 ULONG ulParam1; /* Message flags. */ param2 PMCI_PALETTE_PARMS pParam2; /* Pointer to the MCI_PALETTE_PARMS structure. */
Parameters
- ulParam1 (ULONG) - input
- The following flags can be used:
- MCI_NOTIFY Posts a notification message when the action completes.
- MCI_WAIT Does not return control until the action is completed.
- MCI_SET_REGISTERED Sets the registered palette specified in the `usRegisteredMap` field of the MCI_PALETTE_PARMS structure.
- pParam2 (PMCI_PALETTE_PARMS) - input
- A pointer to the MCI_PALETTE_PARMS data structure.
Returns
- rc (ULONG) - returns
-
- MCIERR_SUCCESS If the function succeeds.
- Other standard MCI error codes may be returned depending on the driver implementation.
Remarks
- **Scope:** This message does not affect motion video, images already being displayed, or images loaded via the MCI_RESTORE message.
- **Palette Matching:** If the number of palette entries specified here does not match the number of colors in a subsequent MCI_SETIMAGEBUFFER call, the image may be displayed with incorrect colors.
- **Map Types:** The color map can be a standard registered map or a custom map provided by the application.
- **Default Processing:** Each image device has a default palette (often the current system palette) used for palettized operations if no palette is explicitly set.
Example Code
The following code demonstrates setting a registered palette for an image device.
USHORT usDeviceID;
MCI_PALETTE_PARMS mciPaletteParms;
mciPaletteParms.hwndCallback = 0;
/* Use a registered palette index, e.g., MCI_PALETTE_OS2_VGA */
mciPaletteParms.usRegisteredMap = MCI_PALETTE_OS2_VGA;
mciSendCommand( usDeviceID,
MCI_SETIMAGEPALETTE,
MCI_SET_REGISTERED | MCI_WAIT,
(PVOID) &mciPaletteParms,
0);