Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
vb.net中wia中扫描仪分辨率的设置_Vb.net_Wia_Image Scanner - Fatal编程技术网

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

vb.net中wia中扫描仪分辨率的设置,vb.net,wia,image-scanner,Vb.net,Wia,Image Scanner,借助上述代码;我的应用程序可以成功扫描任何文档/图像。我想更改扫描仪的分辨率,以便更快地完成扫描过程。请指导我如何设定决议 Dim im = scan.Items(1) Dim ima As WIA.ImageFile = im.Transfer(WIA.FormatID.wiaFormatJPEG) Dim binaryD = ima.FileData().BinaryData Dim imaged

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

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