IImageDecoder::Decode (Compact 2013)

3/26/2014

This feature is being deprecated for this release. Refer to this component: Windows Imaging Component.

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.

Code Example

The following code shows how an application might decode an image frame.

Important

For readability, the following code example does not contain security checking or error handling. Do not use the following code in a production environment.

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

See Also

Reference

IImageDecoder
ImageCodecFlags