Export (0) Print
Expand All

IImageDecodeEventSink::OnBeginDecode Method

Called by the filter to determine which image formats are supported.

Syntax


HRESULT OnBeginDecode(
    DWORD *pdwEvents,
    ULONG *pnFormats,
    BFID **ppFormats
);

Parameters

pdwEvents
[out] The address of a DWORD variable that receives a combination of the following flags.
IMGDECODE_EVENT_PROGRESS
The event sink supports IImageDecodeEventSink::OnProgress.
IMGDECODE_EVENT_PALETTE
The event sink supports IImageDecodeEventSink::OnPalette.
IMGDECODE_EVENT_BEGINBITS
Not currently supported.
IMGDECODE_EVENT_BITSCOMPLETE
The event sink supports IImageDecodeEventSink::OnBitsComplete.
IMGDECODE_EVENT_USEDDRAW
The event sink surface supports IDirectDrawSurface.
pnFormats
[out] The address of an unsigned long integer variable that receives the number of entries in the buffer returned in ppFormats.
ppFormats
[out] 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

Returns S_OK if successful, or an error value otherwise.

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.

See Also

IImageDecodeEventSink::GetSurface

Community Additions

ADD
Show:
© 2015 Microsoft