IImageDecoder::Decode
A version of this page is also available for
4/8/2010
This method tells the decoder object to continue decoding the current frame.
Syntax
HRESULT Decode();
Parameters
None.
Return Value
If successful, this method returns S_OK.
If it fails, this method should return one of the following error values:
- IMGERR_OBJECTBUS
- E_FAIL
For more information, see Error Codes for the Imaging API.
Remarks
A nonblocking decoder should return E_PENDING when it runs out of input data.
To identify a blocking decoder, see if it has the ImageCodecFlagsBlockingDecode flag set. For more information, see ImageCodecFlags.
The following code shows how an application might decode an image frame.
IImageDecoder* decoder;
IImageSink* sink;
HRESULT hr;
hr = decoder->BeginDecode(sink, NULL);
if (FAILED(hr))
{
// handle error;
}
for (;;)
{
hr = decoder->Decode();
if (hr == E_PENDING)
// do something else;
else if (FAILED(hr))
// handle error, break;
else
// decoding successful, break;
}
decoder->EndDecode(hr);
Requirements
Header | imaging.h |
Library | Imaging.lib |
Windows Embedded CE | Windows CE 5.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |