【发布时间】:2016-08-19 20:45:45
【问题描述】:
我在 VS 2015 中从 NuGet 包管理器添加了 Zxing.Net。我尝试使用以下代码来解码 CODE_128 条形码。但它给出了 null 作为结果。
同一张图片在包括Zxing Online Decoder在内的几乎所有在线读码网站都成功解码。
using System;
using System.Drawing;
using ZXing.QrCode;
using ZXing.QrCode.Internal;
public string barcode_scan()
{
string qr = @"C:\Users\Admin\Desktop\barcode.jpg";
ZXing.BarcodeReader reader = new ZXing.BarcodeReader();
var result = reader.Decode((Bitmap)Bitmap.FromFile(qr));
return result;
}
我不知道哪里出错了。
编辑:图片附Image with barcode
【问题讨论】:
标签: c# asp.net-mvc barcode zxing zxing.net