CImagePalette.MakeIdentityPalette method

[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 MakeIdentityPalette method attempts to make an "identity palette," defined as one that maps directly to the palette selected in the display device.

Syntax

HRESULT MakeIdentityPalette(
   PALETTEENTRY *pEntry,
   INT          iColours,
   LPSTR        szDevice
);

Parameters

pEntry

Pointer to an array of palette entries.

iColours

Number of palette entries in pEntry.

szDevice

Pointer to a string that contains the name of the display device, as returned by the GDI EnumDisplayDevices function. To use the main display device, set this parameter to NULL.

Return value

Returns S_OK if successful or S_FALSE if unsuccessful.

Remarks

This method compares the reserved entries in the system palette against the corresponding entries in the pEntry array. If they match exactly, the method sets the PC_NOCOLLAPSE flag in the remaining (non-reserved) palette entries in pEntry. This flag prevents GDI from trying map logical palette entries to system palette entries.

The CImagePalette::MakePalette method calls this method.

Requirements

Requirement Value
Header
Winutil.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CImagePalette Class