This documentation is archived and is not being maintained.

Bitmap.FromResource Method

Creates a Bitmap object from the specified Windows resource.

[Visual Basic]
Public Shared Function FromResource( _
   ByVal hinstance As IntPtr, _
   ByVal bitmapName As String _
) As Bitmap
public static Bitmap FromResource(
 IntPtr hinstance,
 string bitmapName
public: static Bitmap* FromResource(
 IntPtr hinstance,
 String* bitmapName
public static function FromResource(
   hinstance : IntPtr,
 bitmapName : String
) : Bitmap;


A handle to an instance of the executable file that contains the resource.
A string containing the name of the resource bitmap.

Return Value

The Bitmap object that this method creates.


This method works only with bitmaps that are named resources in a DLL.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Bitmap Class | Bitmap Members | System.Drawing Namespace