【发布时间】: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 "";
}
}
任何建议都会有很大帮助。谢谢!
【问题讨论】:
-
不,那是二维码,我想读取多个条形码。
-
DecodeMultiple 无论您是处理二维码还是条形码都可以工作
-
您能否在您的应用程序中通过将一个图像拆分为多个图像来执行此操作,每个图像都包含一个条码,并使用每个图像调用 ZXing?
-
例如,Japanese article 和 Java article 和 Linked article 可能会有所帮助。
标签: c# barcode-scanner zxing.net