I want to use a4 (8.5 x11)
here is my code Im playing with
Code: Select all
Dim nImageID As Integer
If Imaging1.TwainOpenDefaultSource() Then
InitScanConfig()
Imaging1.TwainSetCurrentResolution(100)
Imaging1.TwainSetCurrentPixelType(GdPicturePro4.TwainPixelType.TWPT_BW) 'BW
Imaging1.TwainSetCurrentBitDepth(1) ' 1 bpp
Imaging1.TwainSetPaperSize(1) ' have tried everything here
Imaging1.TwainSetAutoFeed(True) 'Set AutoFeed Enabled
Imaging1.TwainSetAutoScan(True) 'To achieve the maximum scanning rate
While Imaging1.CreateImageFromTwain(Me.Handle.ToInt32) <> 0
nImageID = Imaging1.GetNativeImage
If nImageID <> 0 Then
count += 1
Call Imaging1.SaveAsTiff(My.Application.Info.DirectoryPath & "\acquire" & Str(count) & ".tiff")
Call Imaging1.CloseImage(nImageID)
End If
End While
Imaging1.Crop()
Call Imaging1.TwainCloseSource()
MsgBox("Done !")
Else
MsgBox("can't open default source, twain state is: " & Trim(Str(Imaging1.TwainGetState)))
End If