【问题标题】:Can ZXing can read multiple barcode in the single image using C#?ZXing 可以使用 C# 读取单个图像中的多个条码吗?
【发布时间】:2021-03-26 09:14:13
【问题描述】:

我正在尝试使用 ZXing 库读取 jpg 图像中的多个条形码。但它只返回一个条形码。我没有得到任何关于如何修改我的代码以便它读取多个条形码的资料。我的代码是:

private string readPDFBarcode(String fname) {
            
            IBarcodeReader reader = new BarcodeReader()
            {
                AutoRotate = true,
                TryInverted = true,
                Options = new DecodingOptions
                {
                    TryHarder = true,
                    PureBarcode = false,
                    ReturnCodabarStartEnd = true,
                    PossibleFormats = new List<BarcodeFormat> { BarcodeFormat.CODE_128, BarcodeFormat.CODE_39, BarcodeFormat.UPC_E }
                }
            };
            
            Bitmap oBitmap = new Bitmap(fname);
            var result = reader.Decode(oBitmap);
            if (result != null)
            {
                return result.ToString();
            }
            else {
                return "";
            }
        }

任何建议都会有很大帮助。谢谢!

【问题讨论】:

标签: c# barcode-scanner zxing.net


【解决方案1】:

试试这个:

var results = reader.DecodeMultiple(oBitmap);

如果它在您的环境中不可用,请提供有关目标 .net 框架(经典或核心)的一些信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-25
    • 1970-01-01
    • 1970-01-01
    • 2013-02-12
    • 2014-02-24
    相关资源
    最近更新 更多