110,533
社区成员
发帖
与我相关
我的任务
分享
DecodingOptions decodeOption = new DecodingOptions();
decodeOption.PossibleFormats = new List<BarcodeFormat>() {
BarcodeFormat.EAN_13,
};
ZXing.BarcodeReader br = new BarcodeReader();
br.Options = decodeOption;
ZXing.Result rs = br.Decode(this.barCodeImg.Image as Bitmap);
var txt = rs.Text;
/// <summary>
/// 二维码解析
/// </summary>
/// <returns></returns>
public static string DeCoder()
{
string result = string.Empty;
string strSavePath = @"d://123.png";
if (System.IO.File.Exists(strSavePath))
{
var decoder = new QRCodeDecoder();
result = decoder.decode(new ThoughtWorks.QRCode.Codec.Data.QRCodeBitmapImage(new Bitmap(Image.FromFile(strSavePath))));
}
return result;
}