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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 GetDominantColor

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Dany Posted - Aug 24 2018 : 10:59:52
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
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 25 2018 : 17:08:57
Hi Dany

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



Nigel
Xequte Software
www.imageen.com