ImageEn, unit iexBitmaps

TIEBitmap.IsGrayScale

TIEBitmap.IsGrayScale


Declaration

function IsGrayScale(): boolean;


Description

Checks if all pixels have have equal R, G and B values (i.e. the bitmap is gray-scale).
Specify a Tolerance value to accept images that are almost gray-scale (e.g 5 would allow an approx. 2% variance). This method test all pixels, but allows color values be slightly unequal.


Examples

If ImageEnView1.IEBitmap.IsGrayScale() then
  ShowMessage( 'Image is gray scale' )
else
If ImageEnView1.IEBitmap.IsGrayScale(5) then
  ShowMessage( 'Image is almost gray scale' )
else
  ShowMessage( 'Image is colored' );