Loading...

Save two images with one scan

Support for GdTwain ActiveX and GdTwain Pro ActiveX/SDK.

Save two images with one scan

Postby 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?
mcnewsxp
 
Posts: 11
Joined: Thu Sep 06, 2007 7:27 pm

Postby 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.
fbmachines
 
Posts: 24
Joined: Tue Nov 27, 2007 2:50 am

Postby 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
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4441
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Postby 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.
?????
mcnewsxp
 
Posts: 11
Joined: Thu Sep 06, 2007 7:27 pm

Postby 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
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4441
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Postby mcnewsxp » Fri Dec 14, 2007 10:37 pm

cool
i'll try it,
thanks much!
mcnewsxp
 
Posts: 11
Joined: Thu Sep 06, 2007 7:27 pm


Return to GdTwain [Pro] ActiveX

Who is online

Users browsing this forum: Google [Bot] and 1 guest