IOverlay::GetDefaultColorKey method (strmif.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 GetDefaultColorKey method retrieves the default color key used for a chroma key overlay.

Syntax

HRESULT GetDefaultColorKey(
  [out] COLORKEY *pColorKey
);

Parameters

[out] pColorKey

Pointer to a variable that receives the default color key.

Return value

Returns S_OK if successful. If the method fails, it returns an HRESULT error code.

Remarks

A filter using color keys can get a default color from the video renderer. The default color key can then be installed into the window using IOverlay::SetColorKey. The colors returned through this method vary depending on the current display mode. If the colors are 8-bit palettized, they will be bright system colors (such as magenta). If the display is in a true-color mode, they will be shades of black.

The IOverlay interface is used to ensure that separate instances of the renderer on the same computer get different color keys so that overlays do not conflict.

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 strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Error and Success Codes

IOverlay Interface