QR Code Image Sample - pqScan.com
.NET Barcode Scanner SDK Building up Perfect Quality Barcode Reading Software for .NET Online Demo Download Trial Purchase Now

.NET Barcode Scanner: C# Guide

back to home  >  .NET Barcode Scanner SDK  >  Read Barcodes in .NET  >  C# Barcode Scanning

Nowadays, barcodes exist everywhere. Most commonly, they are printed on baled goods at the supermarket. Salesperson can easily get products details by scanning printed barcodes. With simple scan, all products information will be output, like displaying on computer screen. This looks very easy and fast! Then, how do you integrate mature bar code reading feature into your Visual Studio .NET program? If you are a C# programmer, then, this page can tell you all.

In all, you can use pqScan .NET Barcode Reading Toolkit to scan and decode barcodes from raster image files (BMP, JPEG, PNG, TIFF, and GIF). And with simple Visual C# class code, you may get all encoded bar code data. The following parts will give you the APIs that can be used in C#.NET barcode scanning program. And free C# demo codes are also provided. To begin with, you should download .NET Barcode Scanner SDK package online and add the barcode scanner dll component into your created Visual C# project reference.

APIs for C# Barcode Scanning

There's no need for other barcode plug-ins for your C#.NET project and software integration is simple as described above (Add Reference). Then, you can use the following .NET APIs to read and recognize linear and 2d bar codes on image files. PDF document barcode recognition is also supported now (our .NET SDK for PDF to Image should be used). You may see how to read barcode in PDF using C# for more details.

Till now, C# developers can use pqScan .NET Barcode Scanner Software to read these 1d and 2d bar codes: QR Code, Data Matrix, PDF-417, Aztec Code, Code 128, Code 39, UPC/EAN, Code 93, Codabar, and ITF-14. And the following robust APIs are available for fast C# barcode recognition.

// Read all barcodes types from bitmap/stream/local file value in C# programming.
public static BarcodeResult[] Scan(Bitmap bitmap);
public static BarcodeResult[] Scan(Stream stream);
public static BarcodeResult[] Scan(string filename);

// Choose a barcode type to read from your C# project image resource in bitmap/stream/local file form.
public static BarcodeResult[] Scan(Bitmap bitmap, BarCodeType barType);
public static BarcodeResult[] Scan(Stream stream, BarCodeType barType);
public static BarcodeResult[] Scan(string filename, BarCodeType barType);

// Read a barcode from bitmap/stream/local image. 
// It's suitable when there's only one barcode on image (more accurate).
public static BarcodeResult ScanSingle(Bitmap bitmap);
public static BarcodeResult ScanSingle(Stream stream);
public static BarcodeResult ScanSingle(string filename);

Free Demos for C# Barcode Scanning

As stated above, you can use well-designed methods to get all barcodes values from three forms of image source in Visual C# programming, which include bitmap, stream and local file. And this part gives free C# demo codes for how to read and decode 1d and 2d barcodes in two situations.

Free C# Demo: Read All Barcode Types

public void ScanAllTypeBarcode(Bitmap bmp)
  BarcodeResult[] results = BarCodeScanner.Scan(bmp);
  foreach (BarcodeResult result in results)
    Console.WriteLine(result.BarType.ToString() + "-" + result.Data);

Free C# Demo: Read Specified Barcode Type

public void ScanSpecifiedTypeBarcode(Bitmap bmp)
  BarcodeResult[] results = BarCodeScanner.Scan(bmp, BarCodeType.Code128);
  foreach (BarcodeResult result in results)

Free C# Demo: Read Only One Barcode from Image

// This can improve barcode recognition accuracy. It's suitable when there's only one barcode on image.
Bitmap bmp = new Bitmap("YourImagePath");
BarcodeResult barcode = BarCodeScanner.ScanSingle(bmp);
Console.WriteLine("barcode data:{0}.", barcode.Data);

We also provide online VB.NET guide for how to scan barcode image in VB.NET programming, please see the right menu bar, under Online Guide section.

pqScan SDK
Barcode Reader for .NET
Online Guide
.NET Barcode Recognition VB.NET Barcode Recognition
Barcode Type
C#/VB Class: Scan QR Code C#/VB Class: Scan Data Matrix C#/VB Class: Scan PDF-417 C#/VB Class: Scan Aztec Code C#/VB Class: Scan EAN-13 C#/VB Class: Scan EAN-8 C#/VB Class: Scan UPC-A C#/VB Class: Scan UPC-E C#/VB Class: Scan Code 128 C#/VB Class: Scan Code 39 C#/VB Class: Scan Code 93 C#/VB Class: Scan Codabar C#/VB Class: Scan ITF-14
Your .net barcode recognition software has become one of my favorite tools, which helps to save my business time and money. It is a real pleasure to order with. Kevin Johnson