BarCodeReader.SetBarCodeReadType
Contents
[
Hide
]SetBarCodeReadType(params SingleDecodeType[])
Sets SingleDecodeType
type array for recognition. Must be called before ReadBarCodes() method.
public void SetBarCodeReadType(params SingleDecodeType[] barcodeTypes)
Parameter | Type | Description |
---|---|---|
barcodeTypes | SingleDecodeType[] | The SingleDecodeType type array to read. |
Examples
This sample shows how to detect Code39 and Code128 barcodes.
[C#]
using (BarCodeReader reader = new BarCodeReader())
{
reader.SetBarCodeReadType(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(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
- class SingleDecodeType
- class BarCodeReader
- namespace Aspose.BarCode.BarCodeRecognition
- assembly Aspose.BarCode
SetBarCodeReadType(BaseDecodeType)
Sets decode type for recognition. Must be called before ReadBarCodes() method.
public void SetBarCodeReadType(BaseDecodeType type)
Parameter | Type | Description |
---|---|---|
type | BaseDecodeType | 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
- class BaseDecodeType
- class BarCodeReader
- namespace Aspose.BarCode.BarCodeRecognition
- assembly Aspose.BarCode