IWICBitmapFrameEncode::SetThumbnail method (wincodec.h)

Sets the frame thumbnail if supported by the codec.

Syntax

HRESULT SetThumbnail(
  [in] IWICBitmapSource *pIThumbnail
);

Parameters

[in] pIThumbnail

Type: IWICBitmapSource*

The bitmap source to use as the thumbnail.

Return value

Type: HRESULT

Returns S_OK if successful, or an error value otherwise.

Returns WINCODEC_ERR_UNSUPPORTEDOPERATION if the feature is not supported by the encoder.

Remarks

We recommend that you call SetThumbnail before calling WritePixels or WriteSource. The thumbnail won't be added to the encoded file if SetThumbnail is called after a call to WritePixels or WriteSource.

  • BMP, PNGSetting thumbnails is unsupported. This function will return WINCODEC_ERR_UNSUPPORTEDOPERATION.
  • JPEGSetting the thumbnail is supported. The source image will be re-encoded as either an 8bpp or 24bpp JPEG and will be written to the JPEG’s APP1 metadata block.
  • TIFF Setting the thumbnail is supported. The source image will be re-encoded as a TIFF and will be written to the frame’s SubIFD block.
  • JPEG-XRSetting the thumbnail is supported. The source image will be re-encoded as an additional 8bpp or 24bpp frame.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2, Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header wincodec.h
Library Windowscodecs.lib
DLL Windowscodecs.dll

See also

Conceptual

Encoding Overview

How to Write a WIC-Enabled CODEC

IWICBitmapFrameEncode