BarCodeReader Class

BarCodeReader encapsulates an image which may contain one or several barcodes, it then can perform ReadBarCodes operation to detect barcodes.
Inheritance Hierarchy

Namespace:  Aspose.BarCode.BarCodeRecognition
Assembly:  Aspose.BarCode (in Aspose.BarCode.dll) Version: 21.4.0
Syntax
public class BarCodeReader : Component

The BarCodeReader type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleBarCodeReader
Initializes a new instance of the BarCodeReader class with default values. Requires to set image (SetBitmapImage()) before to call ReadBarCodes() method.
Public methodCode exampleBarCodeReader(Bitmap)
Initializes a new instance of the BarCodeReader class from an image.
Public methodCode exampleBarCodeReader(Stream)
Initializes a new instance of the BarCodeReader class.
Public methodCode exampleBarCodeReader(String)
Initializes a new instance of the BarCodeReader class from file.
Public methodCode exampleBarCodeReader(Bitmap, BaseDecodeType)
Initializes a new instance of the BarCodeReader class.
Public methodCode exampleBarCodeReader(Bitmap, BaseDecodeType)
Initializes a new instance of the BarCodeReader class.
Public methodCode exampleBarCodeReader(Stream, BaseDecodeType)
Initializes a new instance of the BarCodeReader class.
Public methodCode exampleBarCodeReader(Stream, BaseDecodeType)
Initializes a new instance of the BarCodeReader class.
Public methodCode exampleBarCodeReader(String, BaseDecodeType)
Initializes a new instance of the BarCodeReader class.
Public methodCode exampleBarCodeReader(String, BaseDecodeType)
Initializes a new instance of the BarCodeReader class.
Public methodCode exampleBarCodeReader(Bitmap, Rectangle, BaseDecodeType)
Initializes a new instance of the BarCodeReader class.
Public methodCode exampleBarCodeReader(Bitmap, Rectangle, BaseDecodeType)
Initializes a new instance of the BarCodeReader class.
Public methodCode exampleBarCodeReader(Bitmap, Rectangle, BaseDecodeType)
Initializes a new instance of the BarCodeReader class.
Public methodCode exampleBarCodeReader(Bitmap, Rectangle, BaseDecodeType)
Initializes a new instance of the BarCodeReader class.
Properties
  NameDescription
Protected propertyCanRaiseEvents (Inherited from Component.)
Public propertyCode exampleChecksumValidation

Enable checksum validation during recognition for 1D barcodes.

Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.

Checksum never used: Codabar

Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN

Checksum always used: Rest symbologies

Public propertyContainer (Inherited from Component.)
Public propertyCustomerInformationInterpretingType
Gets or sets the Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.
Protected propertyDesignMode (Inherited from Component.)
Public propertyCode exampleDetectEncoding
A flag which force engine to detect codetext encoding for Unicode codesets.
Protected propertyEvents (Inherited from Component.)
Public propertyCode exampleFoundBarCodes
Gets recognized BarCodeResults array
Public propertyCode exampleFoundCount
Gets recognized barcodes count
Public propertyStatic memberCode exampleProcessorSettings
Gets a settings of using processor cores.
Public propertyCode exampleQualitySettings
QualitySettings allows to configure recognition quality and speed manually. You can quickly set up QualitySettings by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of QualitySettings is NormalQuality.
Public propertySite (Inherited from Component.)
Public propertyCode exampleStripFNC
Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
Public propertyCode exampleTimeout
Gets or sets the timeout of recognition process in milliseconds.
Methods
  NameDescription
Public methodCode exampleAbort
Function requests termination of current recognition session from other thread. Abort is unblockable method and returns control just after calling. The method should be used when recognition process is too long.
Public methodCreateObjRef (Inherited from MarshalByRefObject.)
Public methodDispose (Inherited from Component.)
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the BarCodeReader and optionally releases the managed resources
(Overrides ComponentDispose(Boolean).)
Public methodEquals (Inherited from Object.)
Public methodExportToXml(Stream)
Exports BarCode properties to the xml-stream specified
Public methodExportToXml(String)
Exports BarCode properties to the xml-file specified
Protected methodFinalize (Inherited from Component.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetLifetimeService (Inherited from MarshalByRefObject.)
Protected methodGetService (Inherited from Component.)
Public methodGetType (Inherited from Object.)
Public methodStatic memberImportFromXml(Stream)
Imports BarCode properties from the xml-stream specified and applies them to the current BarCodeBuilder instance.
Public methodStatic memberImportFromXml(String)
Imports BarCode properties from the xml-file specified and applies them to the current BarCodeBuilder instance.
Public methodInitializeLifetimeService (Inherited from MarshalByRefObject.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodMemberwiseClone(Boolean) (Inherited from MarshalByRefObject.)
Public methodCode exampleReadBarCodes
Reads BarCodeResults from the image.
Public methodCode exampleSetBarCodeImage(Bitmap)
Sets bitmap image for recognition. Must be called before ReadBarCodes() method.
Public methodCode exampleSetBarCodeImage(Stream)
Sets image stream for recognition. Must be called before ReadBarCodes() method.
Public methodCode exampleSetBarCodeImage(String)
Sets image file for recognition. Must be called before ReadBarCodes() method.
Public methodCode exampleSetBarCodeImage(Bitmap, Rectangle)
Sets bitmap image and area for recognition. Must be called before ReadBarCodes() method.
Public methodCode exampleSetBarCodeImage(Bitmap, Rectangle)
Sets bitmap image and areas for recognition. Must be called before ReadBarCodes() method.
Public methodCode exampleSetBarCodeReadType(BaseDecodeType)
Sets decode type for recognition. Must be called before ReadBarCodes() method.
Public methodCode exampleSetBarCodeReadType(SingleDecodeType)
Sets SingleDecodeType type array for recognition. Must be called before ReadBarCodes() method.
Public methodToString (Inherited from Component.)
Events
  NameDescription
Public eventDisposed (Inherited from Component.)
Examples
This sample shows how to detect Code39 and Code128 barcodes.
[C#]
using (BarCodeReader reader = new BarCodeReader(@"c:\test.png", DecodeType.Code39Standard, DecodeType.Code128))
{
    foreach (BarCodeResult result in reader.ReadBarCodes())
    {
        Console.WriteLine("BarCode Type: " + result.CodeTypeName);
        Console.WriteLine("BarCode CodeText: " + result.CodeText);
    }
}
[VB.NET]
Using reader As New BarCodeReader("c:\test.png", DecodeType.Code39Standard, DecodeType.Code128)
    For Each result As BarCodeResult In reader.ReadBarCodes()
        Console.WriteLine("BarCode Type: " + result.CodeTypeName)
        Console.WriteLine("BarCode CodeText: " + result.CodeText)
    Next
End Using
See Also