Scanner initialization
Scanner initialization
Is there a way to get the scanner to automatically be ready to scan from the ADF when using Twain scanning? Currently every time I run the scanning process the scanner seems to re-initialize and do a bunch of repositioning of the scanning lens before it decides to actually grab a page from the ADF and scan it. It seems like it is looking to see if there is a page on the flatbed before using the ADF.
Thanks,
Randy
Thanks,
Randy
Re: Scanner initialization
Hi,
Maybe calling TwainSelectFeeder(True) can help ?
What is the code you are using to scan?
Kind regards,
Loïc
Maybe calling TwainSelectFeeder(True) can help ?
What is the code you are using to scan?
Kind regards,
Loïc
Re: Scanner initialization
Here is the code (from GdPicture sample code) with "TwainSelectFeeder(True)" added. It didn't help.
Thanks,
Randy
Code: Select all
Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command2.Click
'Here we will scan in a 24bpp & 300 DPI from ADF into separate jpeg files
Dim nImageCount As Integer
Dim ImageID As Integer
If oGdPictureImaging.TwainOpenDefaultSource(Me.Handle) Then
nImageCount = 0
InitScanConfig()
oGdPictureImaging.TwainSetAutoFeed(True) 'Set AutoFeed Enabled
oGdPictureImaging.TwainSetAutoScan(True) 'To achieve the maximum scanning rate
oGdPictureImaging.TwainSetResolution(300)
oGdPictureImaging.TwainSetPixelType(TwainPixelType.TWPT_RGB) 'RGB
oGdPictureImaging.TwainSetBitDepth(8) ' 24 bpp
oGdPictureImaging.TwainSelectFeeder(True)
Do
ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
If ImageID <> 0 Then
Call ApplyImageFilters(ImageID)
If chkPreview.CheckState = 1 Then Call DisplayImage(ImageID)
nImageCount = nImageCount + 1
Call oGdPictureImaging.SaveAsJPEG(ImageID, My.Application.Info.DirectoryPath & "\image" & Trim(Str(nImageCount)) & ".jpg", 75)
Call oGdPictureImaging.ReleaseGdPictureImage(ImageID)
End If
Loop While oGdPictureImaging.TwainGetState > TwainStatus.TWAIN_SOURCE_ENABLED
Call oGdPictureImaging.TwainCloseSource()
MsgBox("Done !")
Else
MsgBox("can't open default source, twain state is: " & oGdPictureImaging.TwainGetState.ToString)
End If
End Sub
Randy
Re: Scanner initialization
Hi Randy,
unfortunately I can't do nothing more.
This behavior is probably caused by your TWAIN driver.
Kind regards,
Loïc
unfortunately I can't do nothing more.
This behavior is probably caused by your TWAIN driver.
Kind regards,
Loïc
Who is online
Users browsing this forum: No registered users and 2 guests