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 engine BarcodeEngine engine = new BarcodeEngine(); // Load the image using (RasterCodecs codecs = new RasterCodecs()) { using (RasterImage image = codecs.Load(imageFileName, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1)) { // Read the first QR barcode from the image BarcodeData 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"); } } } }