BarCodeReader

BarCodeReader class

Namespace: Aspose.Barcode.Recognition

BarCodeReader encapsulates an image which may contain one or several barcodes, it then can perform ReadBarCodes operation to detect barcodes. This sample shows how to detect Code39 and Code128 barcodes.

Constructors

NameDescription
__construct

Methods

NameStaticDescription
containsAnyNoDetermines whether any of the given decode types is included into
exportToXmlNoExports BarCode properties to the xml-file specified
importFromXmlYesImport BarCode properties from xml file
initNo
setBarCodeImageNoQualitySettings 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.
setBarCodeReadTypeNoSets SingleDecodeType type array for recognition. Must be called before readBarCodes() method. This sample shows how to detect Code39 and Code128 barcodes.

Properties

NameRead/WriteDescription
BarCodeDecodeTypeRead-only
FoundBarCodesRead-onlyReads BarCodeResult from the image. Value: The recognized BarCodeResult array
FoundCountRead-onlyGets recognized barcodes count This sample shows how to read barcodes with BarCodeReader Value: The recognized barcodes count
TimeoutRead/WriteGets the timeout of recognition process in milliseconds.

BarCodeReader__construct($imageResource, $areas, $decodeTypes)

ParameterTypeDescription
$imageResource``
$areas``
$decodeTypes``

containsAnycontainsAny($decodeTypes)

Determines whether any of the given decode types is included into

ParameterTypeDescription
$decodeTypes``

Returns: bool Value is a true if any types are included into.

exportToXmlexportToXml(string $xmlFile)

Exports BarCode properties to the xml-file specified

ParameterTypeDescription
$xmlFilestring

Returns: bool Whether or not export completed successfully. Returns True in case of success; False Otherwise

importFromXmlimportFromXml(string $resource) (static)

Import BarCode properties from xml file

ParameterTypeDescription
$resourcestring

Returns: BarCodeReader

initinit()

setBarCodeImagesetBarCodeImage($imageResource, ?Rectangle … $areas)

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.

ParameterTypeDescription
$imageResource``
$areas?Rectangle ...

setBarCodeReadTypesetBarCodeReadType(int … $types)

Sets SingleDecodeType type array for recognition. Must be called before readBarCodes() method. This sample shows how to detect Code39 and Code128 barcodes.

ParameterTypeDescription
$typesint ...

BarCodeDecodeType

Access: Read-only

FoundBarCodes

Access: Read-only

Reads BarCodeResult from the image. Value: The recognized BarCodeResult array

FoundCount

Access: Read-only

Gets recognized barcodes count This sample shows how to read barcodes with BarCodeReader Value: The recognized barcodes count

Timeout

Access: Read/Write

Returns: int timeout.

Gets the timeout of recognition process in milliseconds.

Sets the timeout of recognition process in milliseconds.

ParameterTypeDescription
$valueint