GdPicture.NET Reference Guide
CountUniqueColors Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : CountUniqueColors Method
GdPicture Image Identifier.
Counts the number of unique colors in a GdPicture image or into an area of a GdPicture image defined by SetROI() method.
Syntax
'Declaration
 
Public Function CountUniqueColors( _
   ByVal ImageID As Integer _
) As Integer
public int CountUniqueColors( 
   int ImageID
)
public function CountUniqueColors( 
    ImageID: Integer
): Integer; 
public function CountUniqueColors( 
   ImageID : int
) : int;
public: int CountUniqueColors( 
   int ImageID
) 
public:
int CountUniqueColors( 
   int ImageID
) 

Parameters

ImageID
GdPicture Image Identifier.

Return Value

The number of unique colors.
Remarks
Use the GetStat() method to check if this method has completed successfully.
Example
Counting the number of unique colors in a bitmap.
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("image.jpg")
Dim uniqueColors as Integer = oGdPictureImaging.CountUniqueColors(ImageID)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
MessageBox.Show("Unique colors: " + uniqueColors.ToString())
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
SetROI Method
ResetROI Method