IWICImageEncoder::WriteThumbnail method (wincodec.h)

Encodes the given image as the thumbnail to the given WIC bitmap encoder.

Syntax

HRESULT WriteThumbnail(
  [in] ID2D1Image               *pImage,
  [in] IWICBitmapEncoder        *pEncoder,
  [in] const WICImageParameters *pImageParameters
);

Parameters

[in] pImage

Type: ID2D1Image*

The Direct2D image that will be encoded.

[in] pEncoder

Type: IWICBitmapEncoder*

The encoder on which the thumbnail is set.

[in] pImageParameters

Type: const WICImageParameters*

Additional parameters to control encoding.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

You must create the image that you pass in on the same device as in IWICImagingFactory2::CreateImageEncoder. If you don't specify additional parameters in the variable that pImageParameters points to, the encoder uses a set of useful defaults. For info about these defaults, see WICImageParameters.

Before you call WriteThumbnail, you must set up the IWICBitmapEncoder interface for the encoder on which you want to set the thumbnail.

If WriteThumbnail fails, it might return E_OUTOFMEMORY, D2DERR_WRONG_RESOURCE_DOMAIN, or other error codes from the encoder.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header wincodec.h
Library Windowscodecs.lib
DLL Windowscodecs.dll

See also

IWICImageEncoder

IWICImagingFactory2::CreateImageEncoder

WICImageParameters