Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IWICMetadataQueryReader interface

Exposes methods for retrieving metadata blocks and items from a decoder or its image frames using a metadata query expression.

Members

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

Methods

The IWICMetadataQueryReader interface has these methods.

MethodDescription
GetContainerFormat

Gets the metadata query readers container format.

GetEnumerator

Gets an enumerator of all metadata items at the current relative location within the metadata hierarchy.

GetLocation

Retrieves the current path relative to the root metadata block.

GetMetadataByName

Retrieves the metadata block or item identified by a metadata query expression.

 

Remarks

A metadata query reader uses metadata query expressions to access embedded metadata. For more information on the metadata query language, see the Metadata Query Language Overview.

The benefit of the query reader is the ability to access a metadata item in a single step.

The query reader also provides the way to traverse the whole set of metadata hierarchy with the help of the GetEnumerator method. However, it is not recommended to use this method since IWICMetadataBlockReader and IWICMetadataReader provide a more convenient and cheaper way.

Examples

The following code demonstrates how to obtain a query reader and use it to retrieve a metadata item.


// Get the query reader
if (SUCCEEDED(hr))
{
    hr = pFrameDecode->GetMetadataQueryReader(&pQueryReader);
}

if (SUCCEEDED(hr))
{
    hr = pQueryReader->GetMetadataByName(L"/app1/ifd/{ushort=18249}", &value);
    PropVariantClear(&value);
}

The following code demonstrates how to obtain query reader and use it to retrieve a nested metadata block.


// Get the query reader
if (SUCCEEDED(hr))
{
    hr = pFrameDecode->GetMetadataQueryReader(&pQueryReader);
}

if (SUCCEEDED(hr))
{
    // Get the embedded IFD reader
    hr = pQueryReader->GetMetadataByName(L"/app1/ifd", &value);
    if (value.vt == VT_UNKNOWN)
    {
        hr = value.punkVal->QueryInterface(IID_IWICMetadataQueryReader, (void **)&pEmbedReader);
    }
    PropVariantClear(&value); // Clear value for new query
}

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

 

 

Show:
© 2016 Microsoft