Converts a FreeImage bitmap from one color depth to another. If the conversion fails the original FreeImage bitmap is returned.

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

Syntax

C#
public static FIBITMAP ConvertColorDepth(
	FIBITMAP dib,
	FREE_IMAGE_COLOR_DEPTH conversion,
	byte threshold,
	bool unloadSource
)
Visual Basic (Declaration)
Public Shared Function ConvertColorDepth ( _
	dib As FIBITMAP, _
	conversion As FREE_IMAGE_COLOR_DEPTH, _
	threshold As Byte, _
	unloadSource As Boolean _
) As FIBITMAP
Visual C++
public:
static FIBITMAP ConvertColorDepth(
	FIBITMAP dib, 
	FREE_IMAGE_COLOR_DEPTH conversion, 
	unsigned char threshold, 
	bool unloadSource
)

Parameters

dib
Type: FreeImageAPI..::.FIBITMAP
Handle to a FreeImage bitmap.
conversion
Type: FreeImageAPI..::.FREE_IMAGE_COLOR_DEPTH
The desired output format.
threshold
Type: System..::.Byte
Threshold value when converting with FICD_01_BPP_THRESHOLD.
unloadSource
Type: System..::.Boolean
When true the structure will be unloaded on success.

Return Value

Handle to a FreeImage bitmap.

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