CImagePalette::PreparePalette
Microsoft DirectShow 9.0 |
CImagePalette::PreparePalette
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:
- Calls CImagePalette::MakePalette to create a new logical palette.
- Sends an EC_PALETTE_CHANGED event to the Filter Graph Manager.
- Calls CBaseWindow::SetPalette on the CBaseWindow object.
- Calls CDrawImage::IncrementPaletteVersion on the CDrawImage object.
Requirements
** Header:** Declared in Winutil.h; include Streams.h.
** Library:** Use Strmbase.lib (retail builds) or Strmbasd.lib (debug builds).
See Also