OnBeginDecode method
Called by the filter to determine which image formats are supported.
Syntax
HRESULT retVal = object.OnBeginDecode(pdwEvents, pnFormats, ppFormats);
Parameters
pdwEvents [out]
Type: DWORD
The address of a DWORD variable that receives a combination of the following flags.
IMGDECODE_EVENT_PROGRESS (0x01)
The event sink supports IImageDecodeEventSink::OnProgress.
IMGDECODE_EVENT_PALETTE (0x02)
The event sink supports IImageDecodeEventSink::OnPalette.
IMGDECODE_EVENT_BEGINBITS (0x04)
Not currently supported.
IMGDECODE_EVENT_BITSCOMPLETE (0x08)
The event sink supports IImageDecodeEventSink::OnBitsComplete.
IMGDECODE_EVENT_USEDDRAW (0x10)
The event sink surface supports IDirectDrawSurface.
pnFormats [out]
Type: unsigned long
The address of an unsigned long integer variable that receives the number of entries in the buffer returned in ppFormats.
ppFormats [out]
Type: BFID
The address of a pointer variable that receives an array of GUIDs for the supported formats. Preferred formats appear at the beginning of the array. The following formats are defined.
BFID_MONOCHROME
The surface supports a black-and-white (one-bit, one-channel) format.
BFID_RGB_4
The surface supports a 4-bit index, for a 16-color palette.
BFID_RGB_8
The surface supports an 8-bit index, for a 256-color palette.
BFID_RGB_555
The surface supports a 5-bit, three-channel format, or R(5) G(5) B(5).
BFID_RGB_565
The surface supports 16-bit color, or R(5) G(6) B(5).
BFID_RGB_24
The surface supports 24-bit color, or R(8) G(8) B(8).
BFID_RGB_32
The surface supports 32-bit (byte-aligned) color.
BFID_RGBA_32
The surface supports 32-bit color with alpha channel transparency.
BFID_GRAY_8
The surface supports 8-bit grayscale.
BFID_GRAY_16
The surface supports 16-bit grayscale.
BFID_INDEXED_RGB_1
Same as BFID_MONOCHROME.
BFID_INDEXED_RGB_4
Same as BFID_RGB_4.
BFID_INDEXED_RGB_8
Same as BFID_RGB_8.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
IImageDecodeEventSink::OnBeginDecode is invoked from IImageDecodeFilter::Initialize.
Free the memory associated with the buffer returned in the ppFormats parameter with CoTaskMemFree. See IImageDecodeFilter::Terminate.