Neodynamic Barcode Reader SDK是一款可以对.NET应用和ASP.NET网站添加条码识别和读取功能的高级开发包,可以从数字图像、 位图和扫描的文档等中识别读取多种一维线型条码。支持多种条码类型。
本文将简单介绍如何用Neodynamic Barcode Reader SDK实现条码的识别。
假设需对下图进行解码识别,我们知道这图片中包含了EAN-13码和Code-128码。可参考下面代码,对图片进行扫描识别,再获取控制台结果。
步骤:
- 打开Visual Studio创建应用程序
- 添加引用到System.Drawing.dll 和Neodynamic.SDK.BarcodeReader.dll
- 控制台方法编写,可参考下面代码。
VB 'Add the Barcode Reader namespace reference Imports Neodynamic.SDK.BarcodeReader
'Create a BarcodeReader object Dim myReader As New BarcodeReader() 'Add the barcode symbologies to be recognized myReader.Symbology.Add(Symbology.Ean13) myReader.Symbology.Add(Symbology.Code128) 'Set max num of barcode symbols to be detected myReader.Hints.MaxNumOfBarcodes = 2 'Scan the source image and get result Dim results As List(Of BarcodeScanResult) = myReader.Scan("c:\barcode_sample.jpg") 'Display scan result For Each result As BarcodeScanResult In results Console.WriteLine("Barcode Type: " & result.Symbology.ToString()) Console.WriteLine("Barcode Data: " + result.Text) Console.WriteLine("=============") Next
C#
//Add the Barcode Reader namespace reference using Neodynamic.SDK.BarcodeReader;
//Create a BarcodeReader object BarcodeReader myReader = new BarcodeReader(); //Add the barcode symbologies to be recognized myReader.Symbology.Add(Symbology.Ean13); myReader.Symbology.Add(Symbology.Code128); //Set max num of barcode symbols to be detected myReader.Hints.MaxNumOfBarcodes = 2; //Scan the source image and get result List<BarcodeScanResult> results = myReader.Scan(@"c:\barcode_sample.jpg"); //Display scan result foreach (BarcodeScanResult result in results) { Console.WriteLine("Barcode Type: " + result.Symbology.ToString()); Console.WriteLine("Barcode Data: " + result.Text); Console.WriteLine("============="); }
产品详情evget.com/product/3696(中文)
http://www.neodynamic.com/products/barcode/reader/(英文)