• Neodynamic Barcode Reader SDK使用教程:条码识别


    Neodynamic Barcode Reader SDK是一款可以对.NET应用和ASP.NET网站添加条码识别和读取功能的高级开发包,可以从数字图像、 位图和扫描的文档等中识别读取多种一维线型条码。支持多种条码类型。

    本文将简单介绍如何用Neodynamic Barcode Reader SDK实现条码的识别。

    假设需对下图进行解码识别,我们知道这图片中包含了EAN-13码和Code-128码。可参考下面代码,对图片进行扫描识别,再获取控制台结果。

    barcode

    步骤:

    1. 打开Visual Studio创建应用程序
    2. 添加引用到System.Drawing.dll 和Neodynamic.SDK.BarcodeReader.dll
    3. 控制台方法编写,可参考下面代码。
    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:arcode_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:arcode_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("=============");
    }

    本文译自neodynamicbarcodereader

    产品详情evget.com/product/3696(中文)

                    http://www.neodynamic.com/products/barcode/reader/(英文)

  • 相关阅读:
    10/11
    el表达式的坑
    在idea下两个项目之间的maven父子级项目依赖
    树上任意两点间距离
    优先级顺序
    HDU 6447
    KMP
    cf 1029 C
    牛客练习赛25
    莫比乌斯算法
  • 原文地址:https://www.cnblogs.com/jp294936239/p/5025926.html
Copyright © 2020-2023  润新知