ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 GetDominantColor
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Dany

45 Posts

Posted - Aug 24 2018 :  10:59:52  Show Profile  Reply
Hello;

I am trying to avoid insertion of empty pages from scanner, when user is calling for acquisition but the scanner bin is empty. As ABitmap.IsEmpty returns FALSE and ABitMap.IsAllBlank returns FALSE, I tried:

function IsEmtpyBmp(ABitmap: TIEBitmap): boolean;
var
  d: double;
  p: TImageEnProc;
  domColor: TRGB;
begin
  p := TImageEnProc.Create(nil);
  try
    p.AttachedIEBitmap := ABitmap;
    d := p.GetDominantColor(domColor);
    result := (d > 99);
  finally
    p.Free;
  end;
end;


But GetDominantColor is returning me 34,5 ...

Why is that? and, how can I check if the bitmap is empty?

Thank you.

Dany

xequte

38203 Posts

Posted - Aug 25 2018 :  17:08:57  Show Profile  Reply
Hi Dany

You might need to reduce the number of colors before checking GetDominantColor.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: