IWICImagingFactory::CreateFastMetadataEncoderFromFrameDecode method

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

pIFrameDecoder [in]

Type: IWICBitmapFrameDecode*

The IWICBitmapFrameDecode to create the IWICFastMetadataEncoder from.

ppIFastEncoder [out]

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 | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Wincodec.h

IDL

Wincodec.idl

Library

Windowscodecs.lib

DLL

Windowscodecs.dll

See also

IWICImagingFactory
Conceptual
WIC Metadata Overview
Writing Metadata
Metadata Query Language Overview
Overview of Reading and Writing Image Metadata

 

 

Show: