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
 Detecting blank page
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

hrc

Denmark
6 Posts

Posted - May 11 2015 :  06:25:54  Show Profile  Reply
In a multipage tiff I'm looking for a method to detect blank pages (they are to be removed). The most rigid test would be to check that every point in the page is RGB(0,0,0), but a more intelligent solution would be nice.

Anyone got an idea? Have I overlooked a well hidden IsBlank-function? :-)

(d2009, xe3, currently using an old ImageEN version, but will be upgrading to current very soon)

spetric

Croatia
308 Posts

Posted - May 11 2015 :  08:25:12  Show Profile  Reply
Hi,

you can check dominant color. As written in help:


Percentage := ImageEnView.Proc.GetDominantColor(cl);
If Percentage = 100 then
   ShowMessage('the image is blank!');


Of course, you can use other percentage value (98 or similar).


Go to Top of Page

w2m

USA
1990 Posts

Posted - May 11 2015 :  08:38:44  Show Profile  Reply
There also are the IsEmpty and IsEmpty2 functions.
IsEmpty returns True if the image is empty.
At the moment just checks if the bitmap size is less than 2x2.
IsEmpty2 returns True if the image is empty, i.e. no image has been assigned or loaded.


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: