IXRApplication::LoadImageFromResource (Compact 2013)
This method loads a bitmap image from a binary resource and creates an IWICBitmap object for the resource manager to use.
virtual HRESULT STDMETHODCALLTYPE LoadImageFromResource( HINSTANCE hInstResource, const WCHAR* pResourceName, const WCHAR* pResourceType, IWICBitmap** ppImage ) = 0;
[in] Handle to the instance of the binary module that contains the resource to be loaded. For more information, see the Remarks section.
[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,
[in] Pointer to a string that describes the type of resource as compiled into the resources section of the binary. This can be one of the following:
Image file type
Value that you used in the .rc file for your bitmap image. For example, specify
L"RAW_BITMAP"for a bitmap defined in the .rc file as follows:
ID_RAW_BMP_TEST RAW_BITMAP DISCARDABLE "xaml\\image.bmp"
Do not use
This value is used internally in calls to FindResource and LoadResource.
[out] Pointer to an IWICBitmap object that provides programmatic access to the bitmap image.
An HRESULT returns S_OK if succesful; otherwise, returns a non-zero error code.
In Win32, HINSTANCE and HMODULE both basically 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. Multiple instances of a module can run 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.
XAML for Windows Embedded handles the drawing operation for the bitmap image in ppImage.
.NET Framework Equivalent