Partager via


IXRResourceManager::ResolveImageResource (Compact 2013)

3/28/2014

This method is called by XAML for Windows Embedded to find the location of images declared in XAML markup that XAML for Windows Embedded is currently loading.

Syntax

virtual BOOL STDMETHODCALLTYPE ResolveImageResource(
    const WCHAR* pUri,
    IWICBitmap** ppRetrievedImage
) = 0;

Parameters

  • pUri
    [in] Pointer to a string that contains the Uniform Resource Identifier (URI) (from the XAML file) that specifies the desired resource to resolve.
  • ppRetrievedImage
    [out] Pointer to an IWICBitmap object that lets the application access pixel data of a bitmap-image (JPG or PNG) object.

Return Value

Returns TRUE if the operation was successful; otherwise, returns FALSE.

Remarks

You can override this method to provide custom code that supports XAML for Windows Embedded when it loads an image resource from XAML into a format compatible with the XAML for Windows Embedded system.

When XAML for Windows Embedded loads the XAML markup and parses the elements declared in XAML, it also loads the images that are declared in XAML through URIs.

For example, images in the UI that are defined in XAML can be declared by using the Source attribute of the <Image> element, as follows:

<Image Source="xyz.jpg" />

When XAML for Windows Embedded parses the XAML markup and encounters these image declarations, it calls the resource manager to request information to quickly resolve the image resources declared in the XAML markup. If you want to provide support for resolving the image resources, you must create and register an IXRResourceManager object by calling IXRApplication::RegisterResourceManager.

If you decide to override this method, you can call the IXRApplication::LoadImageFromFile and IXRApplication::LoadImageFromResource methods, referencing all the images that are included in the application user interface (UI). If you do call these methods in your implementation, the application can store its images however it wants, such as in a resource DLL, as a binary large object, as a resource stream, in a file, and so on.

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRResourceManager
IXRResourceManager::ResolveFontResource