How to Read & Scan UPC-A Barcode Image in VB.NET Project
A professional and time-tested UPC-A barcode scanner used for VB.NET program
Easy to redistribute and support .NET Framework 2.0, 3.0, 3.5 and greater
Wholly written in managed C# class, available for both VB.NET & C# library
Read & recognize UPC-A barcode from common image formats & .NET image object
Own a special property to read maximum UPC-A barcode in VB.NET applications
Support partial UPC-A image recognition by introducing the application of coordinates
Instructions for VB.NET UPC-A Barcode Reading Dll Installation
Download free trial version and integrate BarcodeLib.BarcodeReader.dll to your project reference.
How to Scan UPC-A Barcode Images Using Visual Basic .NET Code
The answer to this question will be illustrated with a concrete example. Suppose you will read & decode all UPC-A barcodes from a gif image "upca-vbnet" in C Drive, and the following free VB.NET code will help you achieve that:
Dim datas() AsString = BarcodeReader.read("c:/upca-vbnet.gif", BarcodeReader.UPCA)
How to Optimize UPC-A Barcode Reading in VB.NET Applications
1. If your target UPC-A barcode is large-size, just activate maxOneBarcodePerPage to true. Then the VB.NET UPC-A barcode scanner will stop reading once it detects one barcode.
Otherwise, this .NET barcode reader will use total 5 algorithms and each will read the whole source image from 4 directions.
2. If your target UPC-A barcode is located in a fixed area, just use the following free VB.NET code. Then the VB.NET UPC-A barcode scanner will only scan your specified area. You can specify the area with four points which are expressed in coordinates.
Note: most left top point is (0%, 0%) and most right bottom point is (100%, 100%).
For example, the UPC-A barcode is located in the area (top 20% and bottom 20%), then the VB.NET codes should be built in following ways:
Dim setting As OptimizeSetting = New OptimizeSetting()
setMaxOneBarcodePerPage(True)
Dim top20 As ScanArea = New ScanArea(New Drawing.PointF(0.0F, 0.0F), New Drawing.PointF(100.0F, 20.0F))
Dim bottom20 As ScanArea = New ScanArea(New Drawing.PointF(0.0F, 80.0F), New Drawing.PointF(100.0F, 100.0F))
Dim areas As List(Of ScanArea) = New List(Of ScanArea) areas.Add(top20) areas.Add(bottom20)
setting.setAreas(areas)
Dim datas() AsString = BarcodeReader.read("c:/upca-vbnet.gif", BarcodeReader.UPCA, setting)
How to Decode Other 1D & 2D Barcode Images in VB.NET Class Library