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
[C#]
public static Bitmap FromResource(
 IntPtr hinstance,
 string bitmapName
);
[C++]
public: static Bitmap* FromResource(
 IntPtr hinstance,
 String* bitmapName
);
[JScript]
public static function FromResource(
   hinstance : IntPtr,
 bitmapName : String
) : Bitmap;

Parameters

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

Return Value

The Bitmap object that this method creates.

Remarks

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

Requirements

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

Show: