using ZXing.QrCode;
using ZXing;
using ZXing.Common;
private string BitMap2Txt(Bitmap bmp)
{
BarcodeReader reader = null;
Result result = reader.Decode(bmp); //通过reader解码
if (result != null)
return result.Text; //显示解析结果
else
return "解析失败!";
}
主要就如上一段代码,实现将二维码图片的解析。大部分情况下都是可以解的,但通过摄像头扫了一个包装盒,死活解析不出来。我本以为是摄像头的扫描精度问题,结果将图片保存到电脑后,在屏幕上显示出来,用手机是可以扫出来的。但这段代码就是识别不出来。
