在 WIA 中设置扫描仪的分辨率 vb.net


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)

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

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
...
...

瓦尔特

相关内容

  • 没有找到相关文章

最新更新