0
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)

With the help of above code; My app can successfully scan any document/image. I want to change the resolution of the scanner to get the scanning process complete faster. Please guide me how to set the resolution.

Sahil Manchanda
  • 9,812
  • 4
  • 39
  • 89

1 Answers1

1
Private MyDevice As WIA.Device

and in some sub that you call to set the 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
...
...

valter