This function returns the number of unique colors actually used by the specified 1-, 4-, 8-, 16-, 24- or 32-bit image. This might be different from what function FreeImage_GetColorsUsed() returns, which actually returns the palette size for palletised images. Works for FIT_BITMAP type images only.

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

Syntax

C#
public static int GetUniqueColors(
	FIBITMAP dib
)
Visual Basic (Declaration)
Public Shared Function GetUniqueColors ( _
	dib As FIBITMAP _
) As Integer
Visual C++
public:
static int GetUniqueColors(
	FIBITMAP dib
)

Parameters

dib
Type: FreeImageAPI..::.FIBITMAP
Handle to a FreeImage bitmap.

Return Value

Returns the number of unique colors used by the image specified or zero, if the image type cannot be handled.

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