【示例教程】如何通过leadtools读取二维码中的中文

using Leadtools;using Leadtools.Codecs;using Leadtools.Forms;using Leadtools.Barcode;using Leadtools.ImageProcessing; public void BarcodeData_GetDataExample(){string imageFileName = Path.Combine(LEAD_VARS.ImagesDir, "Barcode2.tif"); // Create a Barcode engineBarcodeEngine engine = new BarcodeEngine(); // Load the imageusing (RasterCodecs codecs = new RasterCodecs()){using (RasterImage image = codecs.Load(imageFileName, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1)){// Read the first QR barcode from the imageBarcodeData data = engine.Reader.ReadBarcode(image, LogicalRectangle.Empty, BarcodeSymbology.QR); // Show the barcode data found (if any)if (data != null){Console.WriteLine("Raw data is:");byte[] bytes = data.GetData();if (bytes != null){string text = System.Text.Encoding.UTF8.GetString(bc);Console.WriteLine(text);}else{Console.WriteLine("Empty");}}else{Console.WriteLine("No barcode found");}}}}

【示例教程】如何通过leadtools读取二维码中的中文

【示例教程】如何通过leadtools读取二维码中的中文

试用、下载、了解更多产品信息请点击“咨询在线客服”  

 

标签:

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2017年10月18日
下一篇 2017年10月18日

相关推荐

发表回复

登录后才能评论