Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET Barcode Reader > C#.NET Barcode Recognition Guide > How to Read QR Code Barcode Image for C#.NET Applications
Download Barcode Reader for .NET Trial

How to Read QR Code 2D Barcode Using C#

Guide for QR Code barcode reading & scanning in C# for .NET projects
  • Effectively compile mature barcode reading features into a C#.NET Barcode Reader DLL
  • Entirely integrate with Visual C#.NET QR Code barcode recognition applications
  • Quickly read 2d barcode, QR Code image, from several source file formats
  • Able to scan and output all QR Code barcode images from one image using free C# codes
  • Read and decode other linear & 2d barcodes, like Codabar, Code 39, Code 128, EAN-13, UPC-A,
    Interleaved 2 of 5, Data Matrix, PDF417, etc
  • Provide several affordable license types for this C# Barcode Scanner in .NET
How to Integrate C#.NET QR Code Barcode Scanner DLL
  1. Please firstly add BarcodeLib.BarcodeReader.dll to your C#.NET project reference.
How to Read QR Code 2D Barcode Images in Visual C#
We provide free C# sample code for QR Code C# barcode reading & scanning, please see as below.
     string[] results = BarcodeReader.read("c:/qrcode-csharp.gif", BarcodeReader.QRCODE);
This C# sample code will decode all the QR Code barcodes in the file "qrcode-csharp.gif".
How to Imporve QR Code Barcode Recognition in Visual C#
To provide better QR Code recognition service, we also design the way to optimize your QR Code barcode reading & decoding. This is suitable when the source image file is in a large size, like 4mb per image.

1. Read the Maximum One Barcode from Image Source

If you need to scan the maximum one barcode in your target image source (per image, page in tiff or pdf document), please set maxOneBarcodePerPage to true.
  1. In this condition, our QR Code C#.NET Barcode Reader DLL will stop reading the barcode as soon as it detects one QR Code barcode.
  2. On the contrary, if this property is false (default value), our QR Code C#.NET Barcode Reader DLL will use total 5 algorithms and each will read the whole source file from 4 directions.

2. Read the Partial Image of a Source File

If the QR Code barcode image is always located on specific area in image file, you can customize our C#.NET Barcode Reader Library to read that area only. And this is a good way to save a lot of reading time, CPU and memory usage.
  1. Please 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 free Visual C# code explains how to read QR Code from a specified area of an image source. Let's take top 20% and bottom 20% of the image as an example.
     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:/qrcode-csharp.gif", BarcodeReader.QRCODE, setting);
How to Read QR Code Barcodes in Other .NET Applications
Scan 1D Barcode Images:
Scan 2D Barcode Images: