VC_SetKeyColourPalIdx

BOOL
VC_SetKeyColourPalIdx(
   VCUSER_HANDLE
vh,
   WORD
PaletteIndex
);

The VC_SetKeyColourPalIdx function requests a kernel-mode video capture driver to set the overlay destination image’s key color to a specified palette index.

Parameters

vh

Handle to the kernel-mode driver, obtained from VC_OpenDevice.

PaletteIndex

Index into the current color palette. This value should be one that can be passed to the PALETTEINDEX macro to obtain a COLORREF value. The PALETTEINDEX macro and the COLORREF type are described in the Win32 SDK.

Return Value

Returns TRUE if the operation succeeds. Otherwise returns FALSE.

Comments

Before setting the key color, the driver should call VC_GetOverlayMode and test the VCO_KEYCOLOUR_FIXED flag to determine if the key color can be set. If the color can be set, the driver should test the VCO_KEYCOLOUR_RGB flag to determine if, based on the current data format, the kernel-mode driver stores the key color as an RGB color or as a palette index number. If the key color is stored as an RGB color, the driver should call VC_SetKeyColourRGB to set it. If the key color is stored as a palette index, the driver should call VC_SetKeyColourPalIdx to set it.

The VC_SetKeyColourPalIdx function calls DeviceIoControl (described in the Win32 SDK) to send an IOCTL_VIDC_SET_KEY_PALIDX control code to the specified kernel-mode driver. When a kernel-mode driver using VCKernel.lib receives this control code, its SetKeyPalIdxFunc function is called.

See Also

VC_GetKeyColour, VC_SetKeyColourRGB