BarCodeResult
BarCodeResult class
Stores recognized barcode data like SingleDecodeType type, string codetext, BarCodeRegionParameters region and other parameters
new BarCodeResult()
Example:
//This sample shows how to obtain BarCodeResult.
let generator = new BarcodeGenerator(EncodeTypes.Code128, "12345");
generator.save("test.png");
let reader = new BarCodeReader("test.png", null, [ DecodeType.CODE_39, DecodeType.CODE_128 ]);
let results = reader.readBarCodes();
for(let i = 0; i < results.length; i++)
{
let result = results[i];
console.log("BarCode Type: " + result.getCodeTypeName());
console.log("BarCode CodeText: " + result.getCodeText());
console.log("BarCode Confidence: " + result.getConfidence());
console.log("BarCode ReadingQuality: " + result.getReadingQuality());
console.log("BarCode Angle: " + result.getRegion().getAngle());
}
Methods
| Name | Description |
|---|---|
| deepClone() | Creates a copy of BarCodeResult class. |
| equals(other) | Returns a value indicating whether this instance is equal to a specified BarCodeResult value. |
| getCodeBytes() | Gets the encoded code bytes Value: The code bytes of the barcode |
| getCodeText(encoding) | Gets the code text with encoding. This example shows how to use getCodeText: let gen = new BarcodeGenerator(EncodeType |
| getCodeType() | Gets the barcode type Value: The type information of the recognized barcode |
| getCodeTypeName() | Gets the name of the barcode type Value: The type name of the recognized barcode |
| getConfidence() | Gets recognition confidence level of the recognized barcode Value: BarCodeConfidence.Strong does not have fakes or misre |
| getExtended() | Gets extended parameters of recognized barcode Value: The extended parameters of recognized barcode |
| getReadingQuality() | Gets the reading quality. Works for 1D and postal barcodes. Value: The reading quality percent |
| getRegion() | Gets the barcode region Value: The region of the recognized barcode |
| hashCode() | Returns the hash code for this instance. |
| toString() | Returns a human-readable string representation of this BarCodeResult. |
deepClone()
Creates a copy of BarCodeResult class.
Returns: Returns copy of BarCodeResult class.
equals(other)
Returns a value indicating whether this instance is equal to a specified BarCodeResult value.
| Parameter | Description |
|---|---|
| other | An BarCodeResult value to compare to this instance. |
Returns: true if obj has the same value as this instance; otherwise, false.
getCodeBytes()
Gets the encoded code bytes Value: The code bytes of the barcode
getCodeText(encoding)
Gets the code text with encoding. This example shows how to use getCodeText: let gen = new BarcodeGenerator(EncodeTypes.DATA_MATRIX, null); gen.setCodeText(“車種名”, “932”); gen.save(“barcode.png”, BarCodeImageFormat.PNG); let reader = new BarCodeReader(“barcode.png”, null, DecodeType.DATA_MATRIX); let results = reader.readBarCodes(); for(let i = 0; i < results.length; i++) { let result = results[i]; console.log(“BarCode CodeText: " + result.getCodeText(“932”)); }
| Parameter | Description |
|---|---|
| encoding | The encoding for codetext. |
Returns: A string containing recognized code text.
getCodeType()
Gets the barcode type Value: The type information of the recognized barcode
getCodeTypeName()
Gets the name of the barcode type Value: The type name of the recognized barcode
getConfidence()
Gets recognition confidence level of the recognized barcode Value: BarCodeConfidence.Strong does not have fakes or misrecognitions, BarCodeConfidence.Moderate could sometimes have fakes or incorrect codetext because this confidence level for barcodews with weak cheksum or even without it, BarCodeConfidence.NONE always has incorrect codetext and could be fake recognitions
getExtended()
Gets extended parameters of recognized barcode Value: The extended parameters of recognized barcode
getReadingQuality()
Gets the reading quality. Works for 1D and postal barcodes. Value: The reading quality percent
getRegion()
Gets the barcode region Value: The region of the recognized barcode
hashCode()
Returns the hash code for this instance.
Returns: A 32-bit signed integer hash code.
toString()
Returns a human-readable string representation of this BarCodeResult.
Returns: A string that represents this BarCodeResult.