Bitmap::GetHbitmap Method (Color)
.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(
Color background
)
Parameters
- background
-
Type:
System.Drawing::Color
A Color structure that specifies the background color. This parameter is ignored if the bitmap is totally opaque.
| 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.
SecurityPermission
for calling into unmanaged code. Related enumeration: UnmanagedCode
.NET Framework
Available since 1.1
Available since 1.1
Show: