The following sample demonstrates how to read barcode from photo image (BarcodeImage.jpg file) in Visual Basic.NET using Bytescout BarCode Reader SDK for .NET

Sample input image for barcode recognition:
barcode vb net

Running sample barcode reading application:barcode reader visual basic

Imports System.IO

Imports Bytescout.BarCodeReader

Module Module1

Sub Main()
Dim pat As String = “….BarcodePhoto.jpg”
Console.WriteLine(“Reading barcode(s) from image {0}”, Path.GetFullPath(pat))

Dim bc As New Reader()
Dim barcodes As FoundBarcode() = bc.ReadFrom(pat)

Dim i As Integer
For i = 0 To barcodes.Length – 1
Console.WriteLine(“Found barcode with type ‘{0}’ and value ‘{1}'”, barcodes(i).Type, barcodes(i).Value)
Next

Console.WriteLine(“Press any key to exit..”)
Console.ReadKey()
End Sub

End Module