Help Center

CImageCtx.LoadBitmapFromResourcemethod

Loads a bitmap from a resource file into the control.

Graphicsmethoddocumented

Syntax

FUNCTION LoadBitmapFromResource (BYVAL hInstance AS HINSTANCE, BYREF wszResourceName AS WSTRING) AS LONG

Parameters

NameDescription
hInstanceHandle to the instance of the module whose executable file contains the resource. A value of NULL specifies the module handle associated with the image file that the operating system used to create the current process.
wszResourceNameThe name of the resource.

Return value

Ok (0) or an error code.

Description

Loads a bitmap from a resource file into the control.

Note: Because GdipCreateBitmapFromResource uses LoadImageW to load the resource, it only works with icons or bitmaps. It works with .bmp and .png files, but fails with .jpg and .tif files.

Reference

  • Defined in AfxNova/CImageCtx.inc:500
  • Documented in Graphics/CImageCtx Class.md
  • Topic: CImageCtx Class