SetBarCodeReadType
isi
[
bersembunyi
]SetBarCodeReadType(params SingleDecodeType[])
SetSingleDecodeType
ketik array untuk pengenalan. Harus dipanggil sebelum metode ReadBarCodes().
public void SetBarCodeReadType(params SingleDecodeType[] barcodeTypes)
Parameter | Jenis | Keterangan |
---|---|---|
barcodeTypes | SingleDecodeType[] | ItuSingleDecodeType ketik array untuk dibaca. |
Contoh
Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.
[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
Lihat juga
- class SingleDecodeType
- class BarCodeReader
- ruang nama Aspose.BarCode.BarCodeRecognition
- perakitan Aspose.BarCode
SetBarCodeReadType(BaseDecodeType)
Mengatur jenis dekode untuk pengenalan. Harus dipanggil sebelum metode ReadBarCodes().
public void SetBarCodeReadType(BaseDecodeType type)
Parameter | Jenis | Keterangan |
---|---|---|
type | BaseDecodeType | Jenis kode batang yang akan dibaca. |
Contoh
Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.
[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
Lihat juga
- class BaseDecodeType
- class BarCodeReader
- ruang nama Aspose.BarCode.BarCodeRecognition
- perakitan Aspose.BarCode