IWICImagingFactory::CreateFastMetadataEncoderFromFrameDecode method (wincodec.h)

Creates a new instance of the fast metadata encoder based on the given image frame.

Syntax

HRESULT CreateFastMetadataEncoderFromFrameDecode(
  [in]  IWICBitmapFrameDecode   *pIFrameDecoder,
  [out] IWICFastMetadataEncoder **ppIFastEncoder
);

Parameters

[in] pIFrameDecoder

Type: IWICBitmapFrameDecode*

The IWICBitmapFrameDecode to create the IWICFastMetadataEncoder from.

[out] ppIFastEncoder

Type: IWICFastMetadataEncoder**

When this method returns, contains a pointer to a new fast metadata encoder.

Return value

Type: HRESULT

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

Remarks

For a list of support metadata formats for fast metadata encoding, see WIC Metadata Overview.

Examples

The following code demonstrates how to use the CreateFastMetadataEncoderFromFrameDecode method for fast metadata encoding.

IWICFastMetadataEncoder *pFME = NULL;
IWICMetadataQueryWriter *pFMEQW = NULL;

hr = pFactory->CreateFastMetadataEncoderFromFrameDecode(pFrameDecode, &pFME);

if (SUCCEEDED(hr))
{
  hr = pFME->GetMetadataQueryWriter(&pFMEQW);
}

if (SUCCEEDED(hr))
{
  // Add additional metadata
  PROPVARIANT value;

  PropVariantInit(&value);

  value.vt = VT_UI2;
  value.uiVal = 99;
  hr = pFMEQW->SetMetadataByName(L"/app1/ifd/{ushort=18249}", &value);

  PropVariantClear(&value);
}

if (SUCCEEDED(hr))
{
  hr = pFME->Commit();
}

Requirements

   
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

IWICImagingFactory

Metadata Query Language Overview

Overview of Reading and Writing Image Metadata

WIC Metadata Overview

Writing Metadata