Save two images with one scan

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
mcnewsxp
Posts: 11
Joined: Thu Sep 06, 2007 7:27 pm

Save two images with one scan

Post by mcnewsxp » Sat Dec 08, 2007 6:20 pm

is it possible to create two images - one color and one black and white - for OCR and archiving with a single pass?

fbmachines
Posts: 24
Joined: Tue Nov 27, 2007 2:50 am

Post by fbmachines » Tue Dec 11, 2007 1:53 am

Good question. I could see the use for this also. If it isn't available in the twain control itself you could probably do an automatic conversion behind the seens with the GDPicture control but this might be too slow for a normal (and High) speed autofeed duplex scanning app. with many documents. Loic might know a more streamlined way to do this without bogging down an app.

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

Post by Loïc » Wed Dec 12, 2007 4:23 pm

Hi,

You can do like that (visual basic sample):

Code: Select all

   Dim nImageID As Long
   
   twain1.TwainOpenDefaultSource
   twain1.TwainSetErrorMessage (True)
   twain1.TwainSetHideUI (True)
   twain1.TwainSetCurrentPixelType (TWPT_RGB)
   twain1.TwainSetCurrentBitDepth (8)
   nImageID = twain1.TwainAcquireToImageID(Me.hWnd)
   twain1.TwainCloseSource
   If nImageID <> 0 Then
      'save as 24bpp
      twain1.SaveAsTiff ("tif24bpp")
      'now save as 1bpp
      twain1.ConvertTo1Bpp
      twain1.SaveAsTiff ("tif1bpp")
      twain1.CloseImage (nImageID)
   End If

Regards,

Loïc

mcnewsxp
Posts: 11
Joined: Thu Sep 06, 2007 7:27 pm

Post by mcnewsxp » Fri Dec 14, 2007 4:52 pm

what i would like to do is one B&W and one color.
one for OCR and one for archive.
?????

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

Post by Loïc » Fri Dec 14, 2007 5:00 pm

Hi,

The code I gave you do that:

One Image color and one B&W image.


Loïc

mcnewsxp
Posts: 11
Joined: Thu Sep 06, 2007 7:27 pm

Post by mcnewsxp » Fri Dec 14, 2007 10:37 pm

cool
i'll try it,
thanks much!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests