Link Search Menu Expand Document

Read 50 Datamatrix barcodes from picture - VB.NET

BarCode Reader SDK sample in VB.NET demonstrating ‘Read 50 Datamatrix barcodes from picture’

Module1.vb
Imports System.IO
Imports Bytescout.BarCodeReader

Module Module1

    Sub Main()
        Const imageFile As String = "50_DataMatrix.png"

        Console.WriteLine("Reading barcode(s) from image {0}", Path.GetFullPath(imageFile))

        Dim reader As New Reader()
        reader.RegistrationName = "demo"
		reader.RegistrationKey = "demo"

        ' Set barcode type to find
        reader.BarcodeTypesToFind.DataMatrix = True

        ' -----------------------------------------------------------------------
        ' NOTE: We can read barcodes from specific page to increase performance .
        ' For sample please refer to "Decoding barcodes from PDF by pages" program.
        ' ----------------------------------------------------------------------- 

        ' Read barcodes
        Dim barcodes As FoundBarcode() = reader.ReadFrom(imageFile)

        For Each barcode As FoundBarcode In barcodes
            Console.WriteLine("Found barcode value: '{0}'", barcode.Value)
        Next

        ' Cleanup
        reader.Dispose()

        Console.WriteLine("Press any key to exit..")
        Console.ReadKey()

    End Sub

End Module

Download Source Code (.zip)

Return to the previous page Explore BarCode Reader SDK


Copyright © 2016 - 2021 ByteScout