none
barcode reader RRS feed

  • Question

  • hi

    I want a way to read barcode from webcam direct with free library

    font = 128

           qrcode

    Friday, November 23, 2018 7:31 PM

Answers

  • Hi,

    1.AForge.NET control Webcamera

    https://www.codeproject.com/Questions/535124/connectingplusapluswebcamplususingplusaforge-netpl

    referenced the two libraries AForge.Video and AForge.Video.DirectShow

    AForge.NET

    2.use ZXing to  decode QR code

    https://github.com/zxing/zxing

    Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
        If Me.openFileDialog1.ShowDialog() <> DialogResult.OK Then
            Return
        End If
    
        Dim img As Image = Image.FromFile(Me.openFileDialog1.FileName)
        Dim bmap As Bitmap
    
        Try
            bmap = New Bitmap(img)
        Catch ioe As System.IO.IOException
            MessageBox.Show(ioe.ToString())
            Return
        End Try
    
        If bmap Is Nothing Then
            MessageBox.Show("Could not decode image")
            Return
        End If
    
        Dim source As LuminanceSource = New RGBLuminanceSource(bmap, bmap.Width, bmap.Height)
        Dim bitmap As com.google.zxing.BinaryBitmap = New com.google.zxing.BinaryBitmap(New COMMON.HybridBinarizer(source))
        Dim result As Result
    
        Try
            result = New MultiFormatReader().decode(bitmap)
        Catch re As ReaderException
            MessageBox.Show(re.ToString())
            Return
        End Try
    
        MessageBox.Show(result.Text)
    End Sub

    Best Regards,

    Alex

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, November 27, 2018 8:53 AM
    Moderator

All replies

  •  I have not searched but,  if you want to use a web-cam then,  it would probably take a specially written library that can do that with a web-cam.  I'm not sure if there is one or not that will work with a web-cam though.  Normally you would buy a bar code reader which comes with example code of how to use it and a library if needed.  However,  most of them can be set to be used like a keyboard,  when you scan the bar-code it will simulate the correct keyboard keys being pressed which you capture with your form or a focused textbox on your form..

     

     Perhaps look at the links in this google search result.

    Google Search Result - 'read bar-code with web-cam vb.net'


    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Friday, November 23, 2018 8:17 PM
    Friday, November 23, 2018 8:12 PM
  • Windows 10 provides native APIs to use WebCam, as well as dedicated barcode scanner devices to read barcodes.

    See microsoft docs at http://aks.ms/camerabarcode for Windows.Devices.PointOfService API usage.  For github samples, see https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BarcodeScanner.

    For quick MS store apps demonstrating Win10 native camera barcode scanner capabilities, see http://aka.ms/JustScanIt


    Monday, November 26, 2018 4:05 AM
  • Hi,

    1.AForge.NET control Webcamera

    https://www.codeproject.com/Questions/535124/connectingplusapluswebcamplususingplusaforge-netpl

    referenced the two libraries AForge.Video and AForge.Video.DirectShow

    AForge.NET

    2.use ZXing to  decode QR code

    https://github.com/zxing/zxing

    Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
        If Me.openFileDialog1.ShowDialog() <> DialogResult.OK Then
            Return
        End If
    
        Dim img As Image = Image.FromFile(Me.openFileDialog1.FileName)
        Dim bmap As Bitmap
    
        Try
            bmap = New Bitmap(img)
        Catch ioe As System.IO.IOException
            MessageBox.Show(ioe.ToString())
            Return
        End Try
    
        If bmap Is Nothing Then
            MessageBox.Show("Could not decode image")
            Return
        End If
    
        Dim source As LuminanceSource = New RGBLuminanceSource(bmap, bmap.Width, bmap.Height)
        Dim bitmap As com.google.zxing.BinaryBitmap = New com.google.zxing.BinaryBitmap(New COMMON.HybridBinarizer(source))
        Dim result As Result
    
        Try
            result = New MultiFormatReader().decode(bitmap)
        Catch re As ReaderException
            MessageBox.Show(re.ToString())
            Return
        End Try
    
        MessageBox.Show(result.Text)
    End Sub

    Best Regards,

    Alex

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, November 27, 2018 8:53 AM
    Moderator


  • Why is this OP allowed to post?

    Every post is spam for spire. I have reported this abuse before.

    I quess I will start spamming my product too since it seems to be allowed now.


    Monday, April 1, 2019 8:07 AM