Testing for (mostly) blank page

Example requests & Code samples for GdPicture Toolkits.
Post Reply
clocklear
Posts: 16
Joined: Fri Jan 11, 2008 11:04 pm

Testing for (mostly) blank page

Post by clocklear » Fri Jan 11, 2008 11:07 pm

If possible, could I see an example of how to determine if an image (gathered from TWAIN) is mostly blank? I'm reading documents from a scanner with an ADF in duplex mode, and I'd like to leave out blank pages in my resulting PDF.

EDIT: Ok nevermind, I figured it out! I still think it'd be a great example though. :)

User avatar
Loïc
Site Admin
Posts: 5597
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Testing for (mostly) blank page

Post by Loïc » Sat Jan 12, 2008 4:18 pm

The IsBlank() method can be used for that.

http://gdpicture.com/references/gdpictu ... Blank.html

ex:

Code: Select all

Dim nImageID As Long

Imaging1.TwainOpenDefaultSource
Imaging1.TwainSetHideUI (False)
nImageID = Imaging1.CreateImageFromTwain()
Imaging1.TwainCloseSource

If nImageID <> 0 Then
   If Imaging1.IsBlank(98) = True Then
      Call Imaging1.CloseImage(nImageID)
   End If
End If
Loïc

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests