Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

The GetColorKey method retrieves the color key being used by a video stream.

Syntax

HRESULT GetColorKey(
  COLORKEY *pColorKey,
 DWORD *pColor
);

Parameters

Value Description

pColorKey

[out] Pointer to a COLORKEYstructure that contains the key type and a palette index.

pColor

[out] Pointer to a value indicating the 8-bit palette index of the COLORKEYstructure returned if the current display mode is 8-bit palettized. Otherwise it is a value representing the color key in the pixel format of the current display mode.

Return Value

Returns an HRESULT value. Possible values include the following:

Value Description

E_INVALIDARG

Invalid arguments, both parameters are NULL.

E_FAIL

GetColorKey failed because the color key isn't known.

NOERROR

Success.

Remarks

Getting the value on the primary stream will retrieve the destination color key being used by the overlay surface. Getting this value on the secondary pin returns the color key being used by that particular stream.

Current DirectShow implementation of this interface can return NULL for either the pColorKey or the pColor parameters; however, the method will fail and return E_INVALIDARG if both parameters are NULL.

NoteThe DWORDvalue returned by the pColor parameter is the actual color being used. So, if the bit depth of the display is 8, 16, 24, 32 the last 8, 16, 24 or 32 bits of the DWORDspecify the actual value of the color key.

See Also