BarCodeReaderSetBarCodeReadType Method (BaseDecodeType)

Sets decode type for recognition. Must be called before ReadBarCodes() method.

Namespace:  Aspose.BarCode.BarCodeRecognition
Assembly:  Aspose.BarCode (in Aspose.BarCode.dll) Version: 21.4.0
Syntax
public void SetBarCodeReadType(
	BaseDecodeType type
)

Parameters

type
Type: Aspose.BarCode.BarCodeRecognitionBaseDecodeType
The type of barcode to read.
Examples
This sample shows how to detect Code39 and Code128 barcodes.
[C#]
using (BarCodeReader reader = new BarCodeReader())
{
    reader.SetBarCodeReadType(new MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128));
    reader.SetBarCodeImage(@"c:\test.png");
    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()
    reader.SetBarCodeReadType(New MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128))
    reader.SetBarCodeImage("c:\test.png")
    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