public BarcodeReader Reader { get; }
@property (nonatomic, strong, readonly) LTBarcodeReader *reader;
public BarcodeReader getReader()
public:
property BarcodeReader^ Reader {
BarcodeReader^ get();
}
Reader # get (BarcodeEngine)
The instance of the BarcodeReader class associated with this barcode engine that can be used to read barcodes from an image.
The BarcodeReader class is used to read one or more barcodes from an image. You cannot create an instance of BarcodeReader directly, instead, use the instance created inside BarcodeEngine which is accessed through BarcodeEngine.Reader.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Barcode;
using Leadtools.ImageProcessing;
public void BarcodeReader_Example()
{
string[] imageFileNames =
{
Path.Combine(LEAD_VARS.ImagesDir, "Barcode1.tif"),
Path.Combine(LEAD_VARS.ImagesDir, "Barcode2.tif")
};
// Create a Barcode engine
BarcodeEngine engine = new BarcodeEngine();
// Get the Barcode reader instance
BarcodeReader reader = engine.Reader;
// Load the image
using (RasterCodecs codecs = new RasterCodecs())
{
foreach (string imageFileName in imageFileNames)
{
using (RasterImage image = codecs.Load(imageFileName, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1))
{
// Read all the barcodes in this image
BarcodeData[] barcodes = reader.ReadBarcodes(image, LeadRect.Empty, 0, null);
// Print out the barcodes we found
Console.WriteLine("{0} contains {1} barcodes", imageFileName, barcodes.Length);
for (int i = 0; i < barcodes.Length; i++)
{
BarcodeData barcode = barcodes[i];
Console.WriteLine(" {0} - {1} - {2}", i + 1, barcode.Symbology, barcode.Value);
}
Console.WriteLine("-----------------");
}
}
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document