CImagePalette.PreparePalette method

The PreparePalette method sets up a palette, based on a media type from the owning filter.

Syntax

HRESULT PreparePalette(
   const CMediaType *pmtNew,
   const CMediaType *pmtOld,
         LPSTR      szDevice
);

Parameters

pmtNew

Pointer to the new media type. The format block must be a VIDEOINFOHEADER structure.

pmtOld

Pointer to the old media type. If the media type is being set for the first time, this parameter can be an empty type with no format block. Otherwise, the format block must be a VIDEOINFOHEADER structure.

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 the palette was updated, or S_FALSE if the palette did not change.

Remarks

If the palette needs to be updated, this method performs the following actions:

Requirements

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

See also

CImagePalette Class