Reg:Capture dual-stream images in scanning

Example requests & Code samples for GdPicture Toolkits.
Post Reply
APScanner
Posts: 2
Joined: Mon Apr 06, 2009 10:28 am

Reg:Capture dual-stream images in scanning

Post by APScanner » Tue Apr 07, 2009 7:16 am

Hi
In my academic project I have one scanning module. But in my project I have one requirement of scanning page in duplex mode with 200 dpi in color. As well as I want to scan single page in Color and black & white in duplex mode means one page will generate four images. Two color images front and back, two images for black and white with front and back. Means I want to scan in multi-stream or dual-stream. And saving color image in JPG format and b/w image in PNG format.
To get my work done which SDK should i used?Does your SDK support dual-stream scanning.If yes how can i get it done.Please also give me idea about licensing about this software.

Thanks & Regards
AP

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

Re: Reg:Capture dual-stream images in scanning

Post by Loïc » Tue Apr 07, 2009 3:58 pm

Hi,

Here the sample required in vb6.

let me know if you need more informations.

Code: Select all

 Dim nImageFront As Long
 Dim nImageBack As Long

 If Imaging1.TwainOpenDefaultSource() Then
     
    Imaging1.TwainEnableDuplex (True)
    Imaging1.TwainSetCurrentResolution (200)
    Imaging1.TwainSetCurrentPixelType (TWPT_RGB) 'RGB
    Imaging1.TwainSetCurrentBitDepth (8) ' 24 bpp
    Imaging1.TwainSetXferCount (1)
      
    'Acquiring the front side
    nImageFront = Imaging1.TwainAcquireToGdPictureImage(Me.hWnd)
    'Saving the front image in color mode (jpeg)
    Imaging1.SaveAsJPEG ("front.jpg")
     'Saving the front image in black & white mode (png)
    Imaging1.ConvertTo1Bpp
    Imaging1.SaveAsPNG ("front.png")
      
     'Acquiring the back side
    nImageFront = Imaging1.TwainAcquireToGdPictureImage(Me.hWnd)
    'Saving the back image in color mode (jpeg)
    Imaging1.SaveAsJPEG ("back.jpg")
     'Saving the back image in black & white mode (png)
    Imaging1.ConvertTo1Bpp
    Imaging1.SaveAsPNG ("back.png")
      
    Imaging1.TwainCloseSource
    
    MsgBox "Done !"
 Else
    MsgBox "can't open default source, twain state is: " & Trim(Str(Imaging1.TwainGetState))
 End If
Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest