Barcode Scanning SDK developed by RaterEdge is designed to read linear, postal and 2D barcodes with flexible functions:
- Read linear & 2D barcodes from single or multi-page files
- Read check digit if the barcode have one
- Detect barcode type with ease
- Return barcode image to string
- Read the barcodes contained in the image
- More image annotation functions
Barcode Scanning
This guide tells users how to read linear & 2D barcode with RasterEdge .NET Imaging SDK and Barcode Reader using Visual C# sample codes. (For VB.NET developers, please go to
Barcode Reading for VB.NET. Want to view Image and document in Winforms or Web applications, please go to
Reading Barcode in Winforms and
Web Document Image Reading.)
- Run Microsoft Visual Studio (2005 or later version);
- Create a project with programming language - Visual C#;
- Add RasterEdge.DotNetImaging.dll & RasterEdge.DotNetImaging.BarcodeScan.dll to your Visual C# applications;
- Call RasterEdge .NET Image Namespace:
using System;
using RasterEdge.Imaging.Basic.Core;
using RasterEdge.Imaging.Basic;
using RasterEdge.Imaging.Barcode.Scanner;
using System.Diagnostics;
using System.Collections.Generic;
using System.Drawing;
Read Barcode Method
Rasteredge provides following method for user to read barcode.
public static string[] Scan(string imageFile, BarcodeType barcodeType);
public static string[] ScanRegions(string imageFile, BarcodeType barcodeType, Setting settings);
Read Barcode Example
The following code shows how to read a barcode:
public static void ReadBarcodeDemo()
{
string fileName = FolderName + "Sample.png";
string[] datas = BarcodeScanner.Scan(fileName, BarcodeType.Code128);
foreach (string data in datas)
{
Debug.WriteLine(data);
}
}
public static void ReadBarcodeFormRegionsDemo()
{
string fileName = FolderName + "Sample.png";
Setting set = new Setting();
set.Code39IncFindPtp = false;
//set.IsMaxOneBarcodePerPage = true;
List<SRegion> areas = new List<SRegion>();
PointF topLeftPoint = new PointF(0, 0);
PointF bottomRightPoint = new PointF(200, 200);
SRegion area = new SRegion(topLeftPoint, bottomRightPoint);
set.setScanRegions(areas);
string[] datas = BarcodeScanner.ScanRegions(fileName, BarcodeType.Code128, set);
foreach (string data in datas)
{
Debug.WriteLine(data);
}
}
More Tutorials!
Find more user guides with RasteEdge .NET Image SDK using Visual C# sample codings!
Want to install Imaging SDK in Winforms or Web applications, please go to
Use Imaging SDK in Winforms and
Web Document Image Viewer.