Export (0) Print
Expand All

IWICMetadataQueryWriter interface

Exposes methods for setting or removing metadata blocks and items to an encoder or its image frames using a metadata query expression.

Members

The IWICMetadataQueryWriter interface inherits from IWICMetadataQueryReader. IWICMetadataQueryWriter also has these types of members:

Methods

The IWICMetadataQueryWriter interface has these methods.

MethodDescription
RemoveMetadataByName

Removes a metadata item from a specific location using a metadata query expression.

SetMetadataByName

Sets a metadata item to a specific location.

 

Remarks

A metadata query writer uses metadata query expressions to set or remove metadata. For more information on the metadata query language, see the Metadata Query Language Overview.

Examples

The following code demonstrates how to create an XMP query writer and add a new metadata item to it.


// Create XMP block
IWICMetadataQueryWriter *pXMPWriter = NULL;

if (SUCCEEDED(hr))
{
    hr = pFactory->CreateQueryWriter(GUID_MetadataFormatXMP, NULL, &pXMPWriter);
}

// Write metadata to the XMP writer
if (SUCCEEDED(hr))
{
    PROPVARIANT value;
    PropVariantInit(&value);

    value.vt = VT_LPWSTR;
    value.pwszVal = L"Metadata Test Image.";
	
    hr = pXMPWriter->SetMetadataByName(L"/dc:title", &value);

    PropVariantClear(&value);
}

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

Conceptual
WIC Metadata Overview
Metadata Query Language Overview
Overview of Reading and Writing Image Metadata
How-to: Re-encode a JPEG Image with Metadata

 

 

Community Additions

ADD
Show:
© 2014 Microsoft