Share via


IXRResourceManager::ResolveImageResource (Windows Embedded CE 6.0)

1/6/2010

This method is called by Silverlight for Windows Embedded to request support with loading images declared in XAML markup.

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

Syntax

virtual BOOL STDMETHODCALLTYPE ResolveImageResource(
    const WCHAR* pUri,
    IBitmapImage** 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 IBitmapImage object that lets the application access pixel data of a bitmap-image object.

Return Value

Returns an HRESULT that indicates whether this operation was successful or not. If this operation fails, this value will be returned from the internal XAML parsing operation.

Remarks

When Silverlight 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 defined in XAML can be declared by using the Source attribute of the <Image> element, as follows:

<Image Source=foo.jpg" />

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

If you decide to override this method, you can call IXRApplication::LoadImageFromFile and IXRApplication::LoadImageFromResource methods, referencing all the images that are included in the application user interface (UI). If you do this, 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
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

IXRResourceManager
IXRResourceManager::ResolveFontResource