Testing for (mostly) blank page

Example requests & Code samples for GdPicture Toolkits.
Post Reply
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
Site Admin
Posts: 5664
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

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


Code: Select all

Dim nImageID As Long

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

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests