How to detect image Scanner in vb.net Programatically

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts Page 1 of 1
Contributors
User avatar
josephpogi05
Just Registered
Just Registered
Posts: 3
Joined: Thu Jun 02, 2011 4:03 am

How to Use Image Scanner In vb.net 2008 Pls Provide Screen Shots I Really need It

Tnx In advanced
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

You can use the Windows Image Acquisition Automation Library to acquire an image from an imaging device.
The useful paramaters will be in the ShowAcquireImage function.
Code: Select all
Imports WIA
Code: Select all
    Private Sub btnScan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScan.Click
        Dim dm As DeviceManager = New DeviceManager()
        If dm.DeviceInfos.Count = 0 Then
            MsgBox("No imaging devices found")
            Return
        End If

        Dim cd As WIA.CommonDialog = New WIA.CommonDialog()
        Dim imgf As ImageFile = cd.ShowAcquireImage(FormatID:=FormatID.wiaFormatJPEG)

        Dim ms As MemoryStream = New MemoryStream(CType(imgf.FileData.BinaryData, Byte()))
        Dim i As Image = Image.FromStream(ms)
        ms.Close()
        PictureBox1.Image = i
    End Sub
2 posts Page 1 of 1
Return to “Tutorial Requests”