This page is a detailed online tutorial for how to use pqScan .NET Barcode Scanner SDK to read and recognize Data Matrix barcode from various images in VB.NET and C# programming environments. If you have downloaded this product package (free trial), then please carefully read through the following parts to have an overall understanding of Data Matrix barcode font recognition for VB.NET and C#.NET programming applications.
At the very beginning, you are supposed to have an overview of pqScan .NET Barcode Recognition SDK (free trial) package. This package mainly contains a PQScan.BarcodeScanner.dll assembly that will be used in Visual C# and Visual Basic .NET Data Matrix recognition projects. Also, pqScan End User License Agreement and a free demo are included in .NET barcode reader software package.
Please note that, for evaluation, C# and VB.NET users do not need to activate this software. And the only limitation for testing is that our .NET barcode scanner software will randomly read the first character encoded in each of your target Data Matrix barcode.
Let's Start 2D Data Matrix Scanning
Our .NET Barcode Reader DLL empowers VB.NET and C#.NET programmers to use well designed barcode decoding APIs to read Data Matrix 2d barcodes from common raster image files, including bmp, gif, jpeg, jpg, png, tif, and tiff, These image files can be loaded in the form of bitmap, local picture or stream. Please note, it's required enough graphs resolution to make the barcode image clear.
Visual C# Data Matrix Scanning
The following APIs can help you to achieve high quality 2d bar code decoding easily. In general, you can use the first three APIs for your Data Matrix reading in C# programs. There may be a group of barcodes in the picture, and can be located in any position of the pictrue, our .net barcode scanner will resolve it easily, can read all the barcode symbol out. If you want to save barcode reading time, you may use the later three APIs to define the barcode type as Data Matrix. Then, our barcode scanner dll component for .NET will only read Data Matrix bar codes from loaded image source.
public static BarcodeResult Scan(Bitmap bitmap);
public static BarcodeResult Scan(Stream stream);
public static BarcodeResult Scan(string filename);
public static BarcodeResult Scan(Bitmap bitmap, BarCodeType barType);
public static BarcodeResult Scan(Stream stream, BarCodeType barType);
public static BarcodeResult Scan(string filename, BarCodeType barType);
In the following code box, you will see Visual C# demo code for defining Data Matrix as target barcode type and read all of them from your load image source (sample: a string value).
public void ScanDataMatrixFromFile(string filename)
// Scan and recognize Data Matrix only from loaded image file.
BarcodeResult results = BarCodeScanner.Scan(filename, BarCodeType.DataMatrix);
foreach (BarcodeResult result in results)
Console.WriteLine(result.BarType.ToString() + "-" + result.Data);
Visual Basic Data Matrix Scanning
Here, we also provide robust APIs and Visual Basic demo code for all barcode types reading from image file, including Data Matrix two-dimensional barcode. For more details of VB.NET barcode reading, please see Barcode Recognition Using VB.NET - Overview
public static BarcodeResult Scan(Bitmap bitmap)
public static BarcodeResult Scan(Stream stream)
public static BarcodeResult Scan(string filename)
public static BarcodeResult Scan(Bitmap bitmap, BarCodeType barType)
public static BarcodeResult Scan(Stream stream, BarCodeType barType)
public static BarcodeResult Scan(string filename, BarCodeType barType)
Public Sub ScanAllFromFile(ByVal filename As String)
' Scan and recognize all barcode types from loaded image file.
Dim results() As BarcodeResult = BarCodeScanner.Scan(filename)
Dim result As BarcodeResult
For Each result In results
Console.WriteLine(result.BarType.ToString() + "-" + result.Data)