Error processing SSI file
LEADTOOLS Barcode (Leadtools.Barcode assembly)

Show in webframe

ReadBarcode(RasterImage,LeadRect,BarcodeSymbology) Method








A RasterImage object that contains the image data. Must not be null.
A LeadRect that specifies the region of interest area in the image where the barcode search and detection is performed. You can specify empty rectangle to indicate that the search must be performed on the whole image.
A BarcodeSymbology enumeration member that specifies the barcode symbology (type) to search for. You can pass BarcodeSymbology.Unknown to search for all available symbologies in this BarcodeReader.

For information about this method please see ReadBarcode.

Syntax
'Declaration
 
Public Overloads Function ReadBarcode( _
   ByVal image As RasterImage, _
   ByVal searchBounds As LeadRect, _
   ByVal symbology As BarcodeSymbology _
) As BarcodeData
'Usage
 
Dim instance As BarcodeReader
Dim image As RasterImage
Dim searchBounds As LeadRect
Dim symbology As BarcodeSymbology
Dim value As BarcodeData
 
value = instance.ReadBarcode(image, searchBounds, symbology)
 function Leadtools.Barcode.BarcodeReader.ReadBarcode(RasterImage,LeadRect,BarcodeSymbology)( 
   image ,
   searchBounds ,
   symbology 
)

Parameters

image
A RasterImage object that contains the image data. Must not be null.
searchBounds
A LeadRect that specifies the region of interest area in the image where the barcode search and detection is performed. You can specify empty rectangle to indicate that the search must be performed on the whole image.
symbology
A BarcodeSymbology enumeration member that specifies the barcode symbology (type) to search for. You can pass BarcodeSymbology.Unknown to search for all available symbologies in this BarcodeReader.

Return Value

An instance of BarcodeData or one of its derived classes that contains the symbology, data, location and any rotation angle of the barcode found. If no barcodes can be found, then this method will return null (Nothing in Visual Basic).
Remarks

Note: In LEADTOOLS for .NET, the equivalent to LeadRect is LogicalRectangle.

Example

This example shows how to use this method to read a single barcode from an image.

Copy Code  
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Barcode;
using Leadtools.ImageProcessing;

      
public async Task BarcodeReader_ReadBarcodeExample1()
{
   string imageFileName = @"Assets\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())
   {
      StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(imageFileName);
      using(RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile)))
      {
         // Read the QR barcode from this image
         BarcodeData barcode = reader.ReadBarcode(image, LeadRectHelper.Empty, BarcodeSymbology.QR);

         // Show its location and data if found
         if(barcode != null)
         {
            Debug.WriteLine("Found at {0}, data:\n{1}", barcode.Bounds, barcode.Value);
         }
         else
         {
            Debug.WriteLine("Not found");
         }
      }
   }
}
Requirements

Target Platforms

See Also

Reference

BarcodeReader Class
BarcodeReader Members
Overload List

Error processing SSI file
Leadtools.Barcode requires a Barcode Module license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features