Share via


IXRApplication::LoadImageFromResource (Windows Embedded CE 6.0)

1/6/2010

This method loads a bitmap image from a binary resource and creates an IBitmapImage object for use by the resource manager.

Syntax

virtual HRESULT STDMETHODCALLTYPE LoadImageFromResource(
    HINSTANCE    hInstResource,
    const WCHAR* pResourceName,
    const WCHAR* pResourceType,
    IBitmapImage** ppImage
) = 0;

Parameters

  • hInstResource
    [in] Handle to the instance of the binary module that contains the resource to be loaded. For more information, see the Remarks section.
  • pResourceName
    [in] Pointer to a string that contains the ID of the resource to load. If you have an integer value, you can convert it to a resource type by using the MAKEINTRESOURCE macro; for example, MAKEINTRESOURCE(IDB_BACKGROUND).
  • pResourceType
    [in] Pointer to a string that describes the type of resource as compiled into the resources section of the binary. This value is used internally in calls to FindResource and LoadResource; for example, L"JPEG" or RT_BITMAP.
  • ppImage
    [out] Pointer to an IBitmapImage object that provides programmatic access to the bitmap image.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

In Win32, HINSTANCE and HMODULE both essentially refer to a handle to a module. HINSTANCE originates from 16-bit Windows programming and persists for continuity between 16-bit Windows and Win32. Most Win32 APIs can accept either an instance handle (HINSTANCE) or a module handle (HMODULE).

In LoadImageFromResource, hInstResource refers to the current execution context of the module that contains the resources, such as bitmaps, that you want to load. There can be multiple instances of a module running at one time. By using hInstResource to reference the module instance, resources loaded by this method can be freed internally by the application instance when it shuts down.

Silverlight handles the drawing operation for the bitmap image in ppImage.

.NET Framework Equivalent

None.

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

IXRApplication