Class BarCodeResult

BarCodeResult class

Stores recognized barcode data like SingleDecodeType type, String codetext, BarCodeRegionParameters region and other parameters

public sealed class BarCodeResult : ICloneable, IEquatable<BarCodeResult>

Constructors

NameDescription
BarCodeResult(BarCodeResult)Creates a a copy of the BarCodeResult class.

Properties

NameDescription
CodeBytes { get; }Gets the encoded code bytes
CodeText { get; }Gets the code text
CodeType { get; }Gets the barcode type
CodeTypeName { get; }Gets the name of the barcode type
Confidence { get; }Gets recognition confidence level of the recognized barcode
Extended { get; }Gets extended parameters of recognized barcode
ReadingQuality { get; }Gets the reading quality. Works for 1D and postal barcodes.
Region { get; }Gets the barcode region

Methods

NameDescription
Clone()Creates a copy of BarCodeResult class.
Equals(BarCodeResult)Returns a value indicating whether this instance is equal to a specified BarCodeResult value.
override Equals(object)Returns a value indicating whether this instance is equal to a specified BarCodeResult value.
GetCodeText(Encoding)Gets the code text with encoding.
override GetHashCode()Returns the hash code for this instance.
override ToString()Returns a human-readable string representation of this BarCodeResult.
operator ==Returns a value indicating whether the first BarCodeResult value is equal to the second.
operator !=Returns a value indicating if the first BarCodeResult value is different from the second.

Examples

This sample shows how to obtain BarCodeResult.

[C#]
using (BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128, "12345"))
{
    generator.Save(@"c:\test.png");
}
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);
        Console.WriteLine("BarCode Confidence: " + result.Confidence);
        Console.WriteLine("BarCode ReadingQuality: " + result.ReadingQuality);
        Console.WriteLine("BarCode Angle: " + result.Region.Angle);
    }
}
[VB.NET]
Using generator As New BarcodeGenerator(EncodeTypes.Code128, "12345")
    generator.Save("c:\test.png")
End Using
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)
        Console.WriteLine("BarCode Confidence: " + result.Confidence)
        Console.WriteLine("BarCode ReadingQuality: " + result.ReadingQuality)
        Console.WriteLine("BarCode Angle: " + result.Region.Angle)
    Next
End Using

See Also