IShellImageData::Decode method (shimgdata.h)

Decodes the image file, setting state.

Syntax

HRESULT Decode(
  [in] DWORD dwFlags,
  [in] ULONG cxDesired,
  [in] ULONG cyDesired
);

Parameters

[in] dwFlags

Type: DWORD

One of the following flags.

SHIMGDEC_DEFAULT (0x00)

Create a full image.

SHIMGDEC_THUMBNAIL (0x01)

Decode only the thumbnail image.

SHIMGDEC_LOADFULL (0x02)

Load the entire image file into memory.

[in] cxDesired

Type: ULONG

The desired horizontal size of the decoded image. This parameter is only used if the SHIMGDEC_THUMBNAIL flag is set. If the SHIMGDEC_DEFAULT flag is set instead, this value is ignored.

[in] cyDesired

Type: ULONG

The desired vertical size of the decoded image. This parameter is only used if the SHIMGDEC_THUMBNAIL flag is set. If the SHIMGDEC_DEFAULT flag is set instead, this value is ignored.

Return value

Type: HRESULT

Returns S_OK if successful, or an error value otherwise, including the following:

Return code Description
E_FAIL
The file could not be loaded or the calling application stopped the decode process through a call to a registered IShellImageDataAbort (see IShellImageData::RegisterAbort for more information).
E_OUTOFMEMORY
The internal object cannot be instantiated.
E_NOTIMPL
The path used to create this instance of IShellImageData was a URL.
S_FALSE
The image has already been decoded.

Remarks

IShellImageData::Decode must be called prior to calling most IShellImageData methods. Not doing so causes those methods to fail.

IShellImageData::Decode attempts to maintain the aspect ratio of the original image, so one of the values passed in cxDesired or cyDesired might be overridden to do so.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shimgdata.h
DLL Shell32.dll