Bitmap::GetHbitmap Method ()
.NET Framework (current version)
Creates a GDI bitmap object from this Bitmap.
Assembly: System.Drawing (in System.Drawing.dll)
public:
[SecurityPermissionAttribute(SecurityAction::LinkDemand, Flags = SecurityPermissionFlag::UnmanagedCode)]
IntPtr GetHbitmap()
| Exception | Condition |
|---|---|
| ArgumentException | The height or width of the bitmap is greater than MaxValue. |
| Exception | The operation failed. |
You are responsible for calling the GDI DeleteObject method to free the memory used by the GDI bitmap object. For more information about GDI bitmaps, see Bitmaps in the Windows GDI documentation.
The following code example demonstrates how to use the GetHbitmap method.
SecurityPermission
for calling into unmanaged code. Related enumeration: UnmanagedCode
.NET Framework
Available since 1.1
Available since 1.1
Show: