Returns an HBITMAP created by the CreateDIBitmap() function which in turn has always the same color depth as the reference DC, which may be provided through hdc. The desktop DC will be used, if IntPtr.Zero DC is specified. Call FreeHbitmap(IntPtr) to free the handle.

Namespace:  FreeImageAPI
Assembly:  FreeImageNET (in FreeImageNET.dll)

Syntax

C#
public static IntPtr GetBitmapForDevice(
	FIBITMAP dib,
	IntPtr hdc,
	bool unload
)
Visual Basic (Declaration)
Public Shared Function GetBitmapForDevice ( _
	dib As FIBITMAP, _
	hdc As IntPtr, _
	unload As Boolean _
) As IntPtr
Visual C++
public:
static IntPtr GetBitmapForDevice(
	FIBITMAP dib, 
	IntPtr hdc, 
	bool unload
)

Parameters

dib
Type: FreeImageAPI..::.FIBITMAP
Handle to a FreeImage bitmap.
hdc
Type: System..::.IntPtr
Handle to a device context.
unload
Type: System..::.Boolean
When true the structure will be unloaded on success. If the function failed and returned false, the bitmap was not unloaded.

Return Value

If the function succeeds, the return value is a handle to the compatible bitmap. If the function fails, the return value is Zero.

Exceptions

ExceptionCondition
System..::.ArgumentNullException dib is null.

Version Information

FreeImage.NET

Supported in: 3.11.0, 3.12.0, 3.13.0, 3.13.1

See Also