VB.NET:Windows Image Acquisition 2双面扫描

时间:2013-06-04 13:40:08

标签: vb.net wia

我得到了以下用于双面扫描的代码,它使用WIA2与扫描仪进行通信。它与富士通fi-6130完美配合,但爱普生GT-S55存在问题。问题是,它保存了双面扫描空白的第二个图像(黑色)。我在这里找不到一处房产吗?。

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    ADFScan()
End Sub

Public Sub ADFScan()
    Dim WiaDialog1 As New WIA.CommonDialog
    Dim WiaDevice1 As WIA.Device = WiaDialog1.ShowSelectDevice(WIA.WiaDeviceType.ScannerDeviceType, False, False)

    WiaDevice1.Properties("3088").let_Value("4")    'WIA_DPS_DOCUMENT_HANDLING_SELECT = 3088, DUPLEX = 4

    Dim Image1 As WIA.ImageFile = DirectCast(WiaDevice1.Items(1).Transfer(WIA.FormatID.wiaFormatBMP), WIA.ImageFile)     'Paper side A
    Dim Image2 As WIA.ImageFile = DirectCast(WiaDevice1.Items(1).Transfer(WIA.FormatID.wiaFormatBMP), WIA.ImageFile)     'Paper side B

    Image1.SaveFile("C:\SideA.bmp")
    Image2.SaveFile("C:\SideB.bmp")
End Sub

我尝试按照C# WIA with Automatic Document Feeder (ADF) retuns only one page on certain scanners的建议将WIA_DPS_PAGES属性设置为1,但它没有用。

这些是Epson扫描仪默认设置的一些属性。

Property name                     ID    Value
--------------------------------------------------------------
Document Handling Capabilities    3086     33
Document Handling Select          3088      1
Document Handling Capacity        3089    100
Pages                             3096      0

提前致谢。

0 个答案:

没有答案