【问题标题】:setting the resolution of scanner in wia in vb.net在 vb.net 的 wia 中设置扫描仪的分辨率
【发布时间】:2014-11-12 11:15:49
【问题描述】:
Dim im = scan.Items(1)
                Dim ima As WIA.ImageFile = im.Transfer(WIA.FormatID.wiaFormatJPEG)
                Dim binaryD = ima.FileData().BinaryData
                Dim imagedata As Byte() = DirectCast(binaryD, Byte())
                Dim ms As New System.IO.MemoryStream(imagedata)
                Dim JImage = Image.FromStream(ms)
                JImage.Save("c:\ImageOne.jpg", Imaging.ImageFormat.Jpeg)

借助上面的代码;我的应用程序可以成功扫描任何文档/图像。我想更改扫描仪的分辨率以更快地完成扫描过程。请指导我如何设置分辨率。

【问题讨论】:

    标签: vb.net wia image-scanner


    【解决方案1】:
    Private MyDevice As WIA.Device
    

    在您调用设置设备的某些子中:

    Dim MyDialog As New WIA.CommonDialog
    
    Try
        MyDevice = MyDialog.ShowSelectDevice(WIA.WiaDeviceType.ScannerDeviceType, True, True)
    Catch ex As Exception
        MsgBox("An error occured")
        Return
    End Try
    
    With MyDevice.Items(1)
        .Properties("6146").Value = 2 '4 is Black-white,gray is 2, color 1 (Color Intent)
        .Properties("6147").Value = 200  'dots per inch/horizontal
        .Properties("6148").Value = 200 'dots per inch/vertical
        .Properties("6149").Value = 0 'x point where to start scan
        .Properties("6150").Value = 0 'y-point where to start scan
        .Properties("6154").Value = brightness  'Brightness
    
        'Following is A4 paper size. (Not 100% accurate because real A4 Ht errors)
        .Properties("6151").Value = 1700 'horizontal exent DPI x inches wide
        .Properties("6152").Value = 2196 'vertical extent DPI x inches tall
        '.Properties("4104").Value = 8 'bits per pixel
    
        '.Properties("3098").Value = 1700 'page width
        '.Properties("3099").Value = 2196 'page height
    
    End With
    ...
    ...
    

    变态

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-25
      • 2012-03-05
      • 2011-05-20
      • 2011-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多