Twain Scanning with Vista

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
bpabmeyer
Posts: 20
Joined: Tue Oct 07, 2008 4:32 pm

Twain Scanning with Vista

Post by bpabmeyer » Thu Mar 11, 2010 5:25 pm

I have an issue with scanning, whenever I run the sample code "twain_sample". The Imaging.CreateImageFromTwain(Me.Handle.ToInt32) returns a 0. I can't seem to get the scanner to scan in the image that I want it to. I am not sure where to go from here. I created my own section of code and I was constantly getting nothing. I went to the SDK samples and get the same issue. Any help will be appreciated. Here are the specs...

Vista Ultimate
GDPicture 5.12.8
Kyocera KM-1820 (All in One) with driver 3.1.1819


Code...

Code: Select all

       Dim nImageID As Integer
        AxImaging1.TwainLogStart("c:\twainlog.txt")

        If AxImaging1.TwainOpenDefaultSource() Then

            InitScanConfig()

            AxImaging1.TwainSetAutoFeed(True) 'Set AutoFeed Enabled
            AxImaging1.TwainSetAutoScan(True) 'To  achieve the maximum scanning rate

            AxImaging1.TwainSetCurrentResolution(300)
            AxImaging1.TwainSetCurrentPixelType(GdPicturePro5.TwainPixelType.TWPT_RGB) 'RGB
            AxImaging1.TwainSetCurrentBitDepth(8) ' 24 bpp
            AxImaging1.TwainPdfStart(imagepath & "Temp.pdf")


            While AxImaging1.CreateImageFromTwain(Me.Handle.ToInt32) <> 0
                nImageID = AxImaging1.GetNativeImage
                DisplayNativeImage()
                AxImaging1.TwainAddGdPictureImageToPdf(nImageID)
                AxImaging1.CloseImage(nImageID)
            End While

            AxImaging1.TwainPdfStop()
            AxImaging1.TwainCloseSource()
            MsgBox("Done !")
        Else
            MsgBox("Can't open default source, TWAIN state is: " & Trim(Str(AxImaging1.TwainGetState)))
        End If

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

Re: Twain Scanning with Vista

Post by Loïc » Fri Mar 12, 2010 4:11 pm

Hi,

We need more information to investigate. Please have a look on this thread: viewtopic.php?t=1486

With best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests