Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET Barcode Reader & Scanner > Best Linear & 2D Barcodes Reader & Decoder for C#, .NET Applications
Download Barcode Reader for .NET Trial

How to Read & Decode Barcode Images in C#.NET

Using free C# code to scan linear & 2d barcode images in .NET applications
  • Complied advanced barcode reading & scanning functions into a mature .NET Barcode Reader Library DLL
  • Effectively run and intalled into Visual Studio .NET Framework 2.0, 3.0, 3.5, 4.0
  • Scan and decode common linear & 2d barcode images in VS C#.NET, ASP.NET web form projects
  • Support barcode image recognition in several file formats, such as Jpg, Gif, Png, Bmp, Tiff
  • Use free Visual C# code to scan maximum one barcode per image, page in tiff or pdf document
  • Use free Visual C# code to read partial 1d or 2d barcode image instead of the whole file
  • Mainly decode and read C# Code 39, C# Code 128, C# EAN-13, C# QR-Code, C# Data Matrix, C# PDF-417, ect
C# Barcode Scanner Library for .NET Introduction
BarcodeLib.com C# Barcode Reader for .NET is a .NET barcode reader component that can recognize linear and 2D barcode images. It can be used in:
  • ASP.NET Website Appliations
  • .NET Windows Forms Appliations
  • .NET, C#, VB.NET Class Library Applications
  • .NET Console Applications
Attention, the first character of barcode data read by the trial package will be a random character.
How to Install C#.NET Barcode Reader Library?
  1. Installation requirement: You should have installed Microsoft .NET Framework Version 2.0 or above.
  2. Add "BarcodeLib.BarcodeReader.dll" to your Visual Studio C#.NET project reference.
How to Read & Recognize Barcode Images Using C#.NET Barcode Reader?
Read barcode from image is a simple task. We will take Code 39 amd QR Code barcodes recognition as exsamples. For other linear & 2d barcode scanning, please see C# Linear & 2d Barcode Recogintion Guides.
     string[] results = BarcodeReader.read("c:/code39-barcode.gif", BarcodeReader.CODE39);

string[] results = BarcodeReader.read("c:/qrcode-barcode.gif", BarcodeReader.QRCODE);
These two free C# sample codes will respectively recognize and output all Code 39 and QR Code barcodes in image files "code39-barcode.gif" & "qrcode-barcode.gif".
How to Read Maximum Barcode Image Using C#.NET Barcode Scanner?
If you need to read a large size image, like 4mb per image, you can adjust our C# Barcode Scanner for .NET to imporve barcode recognition speed.
  1. If there is a maximum one barcode per image, page in tiff or pdf document, please set maxOneBarcodePerPage to true.
  2. If maxOneBarcodePerPage is true, our C#.NET Barcode Scanner DLL will immediately stop reading the barcode once detects one barcode.
  3. If maxOneBarcodePerPage is false (default value), our C#.NET Barcode Scanner Library will use total 5 algorithms and each will read the whole image from 4 directions.
How to Read the Partial Barcode Image Using C#.NET Barcode Reader?
Besides the above two reading methods, you can still recognize the partial image instead of the whole file.
  1. 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.
  2. You just only need to 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 Free C# code explains how to recognize top 20% and bottom 20% of a Code 39 barcode image.
     OptimizeSetting setting = new OptimizeSetting();


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>();


string[] results = BarcodeReader.read("c:/code39-barcode.gif", BarcodeReader.CODE39, setting);
C#.NET Linear & 2D Barcodes Reading & Scanning Tutorials
Please click each barcode to see its barcode C# reading & scanning tutorial in .NET:
Read C# Linear Barcodes:
Read C# Matrix Barcodes:
All Support Linear Barcode Images: Codabar, Code 39, Code 128, Interleaved 2 of 5, EAN 8, EAN 13, UPC-A, UPC-E.

All Support 2D Barcode Images: Data Matrix, PDF 417, QR Code.
If you need C# barcode generating details, please see:

.NET Barcode Reader, ASP.NET Barcode Reader, C#.NET Barcode Reader, VB.NET Barcode Reader, QR Code .NET Reader, QR Code ASP.NET Reader, QR Code C# Reader, QR Code VB.NET Reader, Data Matrix .NET Reader, Code 128 .NET Reader,Code 39 .NET Reader. .NET Barcode Generator Control, ASP.NET Barcode Generator Control.