BarcodeLib.com VB.NET Barcode Reader Library is a mature .NET barcode recognition control that enable users to read & decode linear and 2d barcode images. It can be used in:
ASP.NET Website Projects
.NET Windows Forms Projects
.NET WPF Desktop Application
.NET, C#, VB.NET Class Library
.NET Console Projects
Please note that, the first character of barcode data scanned by the trial package will be a random character.
How to read, scan barcodes in VB.NET?
The VB.NET source code below configures the vb.net barcode reader to scan Code 128 barcode type, loads an image file, and decodes all barcodes from it. It then iterates through each detected Code 128 barcode to retrieve its text message.
Initialize OptimizeSetting specifically for Code 128 barcode decoding.
Read all Code 128 barcodes found in the specified image file, applying the optimization settings.
Loop through each decoded Code 128 barcode in the array. Use method GetMessage to extract the decoded text string from the each Code 128 barcode.
DimoptionsAsNewOptimizeSetting(BarcodeReader.CODE128)
DimbarcodesAsBarCode() =BarcodeReader.ReadBarcode("barcode-sample.png", options)
ForEachbarcodeAsBarCodeInbarcodesDimbarcodeTextAsString=barcode.GetMessage()
Next
Scan multiple barcode formats at one time
The following Visual Basic code configures the barcode reader SDK to recognize both CODE39 and CODE128 barcode types simultaneously, processes the specified image file, and extracts the type and decoded text from each detected barcode.
Create an OptimizeSetting instance that supports multiple barcode symbologies (Code 39 and Code 128).
Call method BarcodeReader.ReadBarcode() to read all barcodes from the specified image file using the multi-symbology settings.
Iterate through each detected barcode in the result BarCode object array. Retrieve the barcode type name and text string message.
DimoptionsAsNewOptimizeSetting(NewInteger() {
BarcodeReader.CODE39, BarcodeReader.CODE128})
DimbarcodesAsBarCode() =BarcodeReader.ReadBarcode("barcode-formats-sample.png", options)
ForEachbarcodeAsBarCodeInbarcodesDimbarcodeTypeAsString=barcode.GetTypeName()
DimbarcodeTextAsString=barcode.GetMessage()
Next
Read colored, rotated, no text label barcodes in VB
BarcodeLib VB.NET Barcode Reader SDK supports automatically scanning all kinds of barcode, including colored barcode, rotated barcode, and barcode without text label printed.
How to improve barcode reading performance in VB.NET?
Quick to scan a single barcode
When processing a large image file. For instance, one that is 8MB in size, and that image contains only a single barcode, you can boost the decoding speed by using the following setting.
If the MaxOneBarcodePerPage option is enabled, the barcode reader library will stop scanning the remaining parts of the image immediately after it finds the first valid barcode.
Besides scanning the whole image, the barcode scanner library also provides the ability to scan specific regions, which helps boost reading speed.
The VB.NET source code below illustrates how to scan only the top 20% and bottom 20% of an image during barcode detection. This approach significantly cuts down on scanning time, CPU usage, and memory footprint.
To set up a scanning region, you simply need to specify the top‑left and bottom‑right anchor points. Each coordinate is given as a percentage of the image's total width and height. For example, (0%, 0%) denotes the top‑left corner, while (100%, 100%) denotes the bottom‑right corner of the entire image.
The VB.NET barcode component enables you to restrict scanning to specific directional axes. This option is controlled through the OptimizeSetting class via the setReadDirectionOrder() method.
You may specify a single direction or a combination of directions for scanning the image.
When the VB.NET barcode reading library handles a raster image, it processes the pixel data sequentially, row by row. The scanning resolution can be fine‑tuned through the ReadOncePerRowsCount property available in the OptimizeSetting class.
In certain cases, enlarging a barcode image can significantly improve the read rate, as it supplies the decoding engine with a richer, more defined image. Turning an otherwise blurry or indistinct barcode into decipherable data.
The Visual Basic code below explains how to apply image zooming using BarcodeLib VB.NET Barcode Scanner library.
ASCII table includes 128 characters. 95 printable characters and 33 control characters (non-printing chars).
The following barcode types support ASCII characters encoding and decoding in VB.NET
Code 128
Code 39 (full ASCII mode)
QR Code
Data Matrix
PDF417
This VB.NET code shows the barcode reader to recognize a wide range of symbologies (CODE39 Extended, CODE128, QR Code, Data Matrix, and PDF417) in a single image file. It then decodes all detected barcodes and uses method GetMessageInASCII to retrieve their ASCII‑encoded message content.
All 2d barcodes (QR Code, Data Matrix, PDF-417) supports Unicode text encoding. Using barcode reader library, you use
GetMessage() to read the decoded Unicode text from 2d barcodes automatically.
The barcode symbologies support not only ISO standard, but also GS1 specification.
Code 128 (GS1-128)
QR Code (GS1 QR Code)
Data Matrix (GS1 Data Matrix)
To read GS1 text message from above barcode symbologies, you need apply
The Visual Basic source code below shows the vb.net barcode reader to recognize QR Code, Data Matrix, and CODE128 symbologies, and enables GS1‑compliant decoding. It processes an image file containing GS1 barcodes, iterates through all detected barcodes, and extracts the full GS1 message (including Application Identifiers) only for those that are GS1‑compatible.
Create an OptimizeSetting instance that supports Code 128, QR Code and Data Matrix barcode symbologies.
Enable GS1 barcode reading mode. The barcode library will scan and decode GS1-128, GS1 QR Code and GS1 Data Matrix barcodes only.
Iterate through each detected barcode in the result array.
Use property IsGS1Compitable to check whether the current barcode is GS1 compatible.
Use method GetMessage to print the GS1 text message.