IMixerPinConfig::GetColorKey method (mpconfig.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

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

Syntax

HRESULT GetColorKey(
  [out] COLORKEY *pColorKey,
  [out] DWORD    *pColor
);

Parameters

[out] pColorKey

Pointer to a COLORKEY structure that contains the key type and a palette index.

[out] pColor

Pointer to a value indicating the 8-bit palette index of the COLORKEY 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:

Return code 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.

Note  The DWORD value 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 DWORD specify the actual value of the color key.
 

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header mpconfig.h
Library Strmiids.lib

See also

Error and Success Codes

IMixerPinConfig Interface

IMixerPinConfig::SetColorKey