Microsoft DirectX 9.0


The CopyPalette method copies the palette from any VIDEOINFO structure to any palettized VIDEOINFO structure.


HRESULT CopyPalette(
    const CMediaType *pSrc,
    const CMediaType *pDest



Pointer to the source media type.


Pointer to the destination media type.

Return Value

Returns S_OK if the palette was copied. Returns S_FALSE if either the source or destination media type does not have a palette.


The pDest media type must be a palettized format with a color depth of 8 bits or less. The pSrc media type can be any VIDEOINFOHEADER type with a palette, including YUV and true-color formats with palette entries. The method copies the palette entries from pSrc into a new palette, and attaches the new palette to pDest.

See Also