ColorCount example for Delphi
This example displays a message box showing the number of unique colors in the control's current bitmap.
var
szMessage: String;
NumberOfColors: Integer;
begin
{ Get the number of colors in the bitmap. }
NumberOfColors := Lead1.ColorCount;
{ Display the result in a message. }
szMessage := 'The bitmap has ' + IntToStr(NumberOfColors) + ' colors';
ShowMessage(szMessage);
end;