【发布时间】:2014-01-07 05:58:51
【问题描述】:
我想用 zxing.net 和 DecodeMultiple 方法解码多个 QR 码,但默认情况下它返回 null 集合结果。 当我调整图片大小然后解码时,大部分 QR 码都已成功解码,但有一两个小 QR 码无法解码。 这是我的图片:
这是我的代码:
BarcodeReader reader = new BarcodeReader();
reader.PossibleFormats = new List<BarcodeFormat>();
reader.PossibleFormats.Add(BarcodeFormat.QR_CODE);
reader.AutoRotate = false;
reader.TryHarder = false;
Bitmap input = (Bitmap)Bitmap.FromFile(Application.StartupPath + "\\1.jpg");
Resize_Picture(Application.StartupPath + "\\1.jpg", Application.StartupPath + "\\1_resized.jpg", 800, 0, 100);
var results = reader.DecodeMultiple((Bitmap)Bitmap.FromFile(Application.StartupPath + "\\2.jpg"));
为什么这张图片需要调整大小? QR 码的最佳尺寸是多少。请指导我在不调整图像大小的情况下进行解码。 谢谢
编辑后(我添加二维码进行测试):
我上传了我的二维码,你可以从here下载。
【问题讨论】:
标签: c# barcode qr-code zxing barcode-scanner