VB.NET Barcode Reader How-Tos
PM > Install-Package BarcodeLib.BarcodeReader


.NET Barcode Scanner > VB.NET Barcode Scanning Guide > VB.NET UPC-A Barcodes Reader Component, supports VB.NET 2d barcode scanning

UPC-A VB.NET Barcode Scanner Library DLL


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
This document provides a technical guide for scanning and reading UPC-A barcode images in Visual Basic .NET Windows applications, with specific support for Windows Forms and WPF.

VB.NET UPC-A Barcode Reader Library

QR Code, Data Matrix, Code 128, GS1, EAN/UPC. Multi-thread reading in VB.NET Windows Forms, WPF application.

Download Now
NuGet Ready
.NET 5+
.NET Framework 4.x, 3.x, 2.x


Scanning and reading UPC-A barcodes from images is a core function of the BarcodeLib .NET Barcode Reader SDK control. It is compatible with Microsoft Visual Studio .NET Framework 2.0 and later versions. The BarcodeLib VB.NET barcode scanner is a robust and mature .NET barcode recognition component for VB.NET projects. One can easily scan and decode linear and 2D barcodes from image documents in VB.NET class, console application, ASP.NET web projects, and VB.NET Windows software (including WinForms and WPF).
Instructions for VB.NET UPC-A Barcode Reading Dll Installation
  1. 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() As String = 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() As String = BarcodeReader.read("c:/upca-vbnet.gif", BarcodeReader.UPCA, setting)


Scan UPC-A Barcodes in VB.NET WinForms and WPF Applications

This section describes how to scan and recognize UPC-A (12-digit universal product linear barcode) using the BarcodeLib VB.NET Barcode Reader library. The instructions apply to both Windows Forms and WPF desktop applications.

UPC-A barcode scanning can be implemented with a direct method call in VB.NET. The core scanning method accepts an image source and target barcode type as input parameters. The following VB.NET example code explains the steps to scan UPC-A barcodes:
  • Call the core decoding method BarcodeScanner.Scan().
  • Pass the barcode image file path as the first parameter.
  • Specify the barcode type as BarcodeType.UPCA.
  • The method returns a string array containing all decoded barcode data.
Note:
  • The BarcodeType.UPCA parameter must be used for standard UPC-A barcodes (12 digits, including the check digit).
  • The library automatically verifies the UPC-A check digit. A null or empty result indicates verification failure.
  • For images containing multiple UPC-A barcodes, the method returns all decoded strings.
  • Supported image formats include BMP, GIF, JPEG, PNG, and TIFF (including multi-page TIFF) in both WinForms and WPF applications.
  • When using in-memory Stream objects (e.g., from a PictureBox in WinForms or BitmapImage in WPF), the overloaded Scan() method accepting a Stream is available.


Summary

This page convers UPC-A barcode scanning in VB.NET using BarcodeLib. The library provides straightforward API calls, automatic check digit validation, and full compatibility with Windows Forms and WPF. For other barcode symbologies such as EAN-13, Code 128, or QR Code, refer to the respective documentation sections.

UPC-A 1D Barcode Recognition Contorls for Related .NET Programs