Bitmap.FromHicon Method (IntPtr)

 

Creates a Bitmap from a Windows handle to an icon.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

static member FromHicon : 
        hicon:nativeint -> Bitmap

Parameters

hicon
Type: System.IntPtr

A handle to an icon.

Return Value

Type: System.Drawing.Bitmap

The Bitmap that this method creates.

The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. The code performs the following actions:

  • Gets the handle to an existing icon image.

  • Creates a Bitmap from the handle.

  • Draws the Bitmap to the screen.

No code example is currently available or this language may not be supported.

SecurityPermission

for calling into unmanaged code. Related enumeration: UnmanagedCode

.NET Framework
Available since 1.1
Return to top
Show: