←Select platform

BarcodeData Constructor()

Summary
Initializes a new instance of the BarcodeData class with default values.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public BarcodeData() 
- (instancetype)init 
public BarcodeData() 
public: 
BarcodeData(); 
__init__() # Default constructor 
Remarks

This constructor initializes the BarcodeData member as follows:

Member Value
Symbology BarcodeSymbology.Unknown
Bounds LeadRect.Empty
RotationAngle 0
BarWidthReduction 0
Byte array inside GetData null (Nothing in Visual Basic)
Value null (Nothing in Visual Basic)
Tag null (Nothing in Visual Basic)

To quickly construct a new BarcodeData object with a specific symbology and data, use BarcodeData(BarcodeSymbology symbology, byte[] data) or BarcodeData(BarcodeSymbology symbology, string value).

To create an instance of BarcodeData suitable for writing for a specified symbology, use CreateDefaultBarcodeData.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Barcode; 
using Leadtools.ImageProcessing; 
 
 
public void BarcodeData_Example() 
{ 
   string imageFileName = Path.Combine(LEAD_VARS.ImagesDir, "Barcode1.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 barcode 
         BarcodeData data = engine.Reader.ReadBarcode(image, LeadRect.Empty, BarcodeSymbology.Unknown); 
 
         // Show the barcode data found (if any) 
         if (data != null) 
         { 
            Console.WriteLine("Found barcode at {0}", data.Bounds); 
            Console.WriteLine("Symbology: {0}", data.Symbology); 
            Console.WriteLine("Data: {0}", data.Value); 
         } 
      } 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.9
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Barcode Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.