The C# UPC A Reader SDK is a high performance linear and 2D barcode recognition SDK for Microsoft Visual Studio .NET platforms. Scanning and reading UPC A barcodes from image files is one of the barcode decoding functions provided by the .NET Barcode Reader component.
C# UPC-A Barcode Reader Library
QR Code, Data Matrix, Code 128, GS1, EAN/UPC. Multi-thread reading in C# ASP.NET, Windows application.
The above C# code will get all UPC-A barcodes in image file "upca-barcode.gif".
Scan & Read UPC-A Barcodes in VB.NET
Scan and read UPC-A barcode in VB.NET is an easy and simple task. One line of vb.net code finishes the job.
Dim datas() AsString = BarcodeReader.read("c:/upca-barcode.gif", BarcodeReader.UPCA)
The above VB.NET code will get all UPC-A barcodes in image file "upca-barcode.gif".
Optimize UPC-A Barcode Reading Performance in C#.NET & VB.NET
You can customize our .NET barcode reader component, to improve UPC-A barcode reading speed, when you are scanning large image size (like 4mb per image).
Set maxOneBarcodePerPage to true, if there is maximum one barcode per image or per page in tiff or pdf document. If maxOneBarcodePerPage is true, the .net barcode reader library will stop scanning the barcode immediately, once detects one barcode. If maxOneBarcodePerPage is false (default value), the library will use total 5 algorithms and each will scan the whole image from 4 directions.
Scan the partial image instead of the whole file. If the barcode is always located one specified area in the image, you can set and let the library scan that area only. And it will reduce lots of scanning time, CPU and memory usage. You just specify the left top point and right bottom point of the area (the point X, Y values are expressed in percentage of the whole image, so image most left top point is (0%, 0%), and most right bottom point is (100%, 100%)).
The following C# code explains how to scan top 20% of the image and bottom 20% of the image.
OptimizeSetting setting = new OptimizeSetting();
setting.setMaxOneBarcodePerPage(true);
ScanArea top20 = new ScanArea(new PointF(0.0F, 0.0F), new PointF(100.0F, 20.0F));
ScanArea bottom20 = new ScanArea(new PointF(0.0F, 80.0F), new PointF(100.0F, 100.0F));
List<ScanArea> areas = new List<ScanArea>(); areas.Add(top20); areas.Add(bottom20);
The following VB.NET code explains how to scan top 20% of the image and bottom 20% of the image.
Dim setting As OptimizeSetting = New OptimizeSetting()
setting.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-barcode.gif", BarcodeReader.UPCA, setting)
Note about UPC-A barcode scanning
The library automatically verifies the UPC A check digit; only valid symbols are returned.
For images containing multiple UPC A symbols, the Scan() method returns an array of all decoded values.
When scanning from multi page TIFF documents, each page is processed sequentially; all barcodes found are returned.
For best recognition results, ensure the barcode image has sufficient resolution (minimum 150 DPI) and adequate quiet zones (at least 10X the narrow bar width).
Summary
This tutorial has provided a comprehensive guide to integrating UPC A barcode reading capabilities into .NET applications using C# and VB.NET. Developers can leverage the BarcodeLib Barcode Reader SDK to scan and decode UPC A symbols from image files, retrieve barcode data, and access detailed properties such as position and rotation. The component seamlessly integrates into ASP.NET web applications, WinForms desktop applications, and WPF based solutions, enabling robust UPC A barcode reading functionality across multiple .NET environments.