How to Read & decode EAN-13 Barcode Using Free Sample VB.NET Programming Code
An easy-to-use EAN-13 .net barcode reader, compatible with both VB.NET & C# class
Professional EAN-13 decoding dll with high reading speed in VB.NET applications
Can be customized to scan EAN-13 in a specific area using free VB.NET code
Decode EAN-13 barcode images in VB.NET class & VB ASP.NET web applications
Able to read & output over 20 linear & 2D barcode types using VB.NET library
Royalty-free VB.NET Barcode Reader Library Server License for .NET Programmers
This document provides a technical guide for scanning and reading EAN-13 barcode images in Visual Basic .NET Windows applications, with specific support for Windows Forms and WPF.
Scanning and reading EAN-13 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).
Guide to Embed VB.NET EAN 13 Bar Coding Reader SDK into VS
Download & unzip the free trial package and find "BarcodeLib.BarcodeReader.dll". Then click "Add Reference..." in the Solution Explorer and add above reader dll to your project reference.
Guide to Scan EAN 13 Barcode Images Using VB.NET Class Programming
Use one-line VB.NET programming code, you can read & encode all EAN13 barcode images from an image source called "ean13-vbnet.gif".
Dim datas() AsString = BarcodeReader.read("c:/ean13-vbnet.gif", BarcodeReader.EAN13)
Guide to Customize EAN-13 Barcode Encoding SDK Using VB.NET Code
If you meet the below situations, you could actually optimize the scanning effects by activating some special features of VB.NET EAN-13 Barcode Encoding SDK.
1. Need to read a maximum EAN-13 barcode
When you are under such a condition, you just need to set maxOneBarcodePerPage to true. Then, our EAN13 barcode scanner will stop reading once it detects one barcode.
If you set maxOneBarcodePerPage to false, our reader will use total 5 algorithms and each will read the whole source file from 4 directions.
2. Need to decode EAN13 barcodes which are concentrated in one certain area of the image file
When you are under such a condition, you could command the barcode reader to scan in a specific area by axis-positioning.
Please note 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 free VB.NET codes are used to direct scanner to read the top 20% and bottom 20% area of the image.
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:/ean13-vbnet.gif", BarcodeReader.EAN13, setting)
Scan EAN-13 Barcodes in VB.NET WinForms and WPF Applications
This section demonstrates how to scan and recognize EAN-13 (13-digit international standard linear barcode) using the BarcodeLib VB.NET Barcode Reader library.
EAN-13 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.
Follow these steps to scan EAN-13 barcodes in VB.NET (compatible with WinForms and WPF):
Call the core decoding method BarcodeScanner.Scan().
Pass the barcode image file path as the first parameter.
Specify the barcode type as BarcodeType.EAN13.
The method returns a string array containing all decoded barcode data.
Note: This method supports common image formats (GIF, PNG, JPG) in VB.NET desktop applications (Windows Forms and WPF). For EAN-13 barcodes, the returned string includes the full 13 digits; the check digit is automatically verified by the library.
Summary
This page has covered the basic scanning procedure for EAN-13 barcodes using BarcodeLib in VB.NET environments, including Windows Forms and WPF. The library automatically verifies the embedded check digit and returns valid data only. For advanced features such as reading EAN-13 with add on symbols, extracting barcode position, or scanning from multi page TIFF files, refer to the complete BarcodeLib .NET documentation.
How to Use Free VB.NET Code to Scan Other Linear & 2D Barcodes