SetBarCodeImage
SetBarCodeImage(Bitmap)
Mengatur gambar bitmap untuk pengenalan. Harus dipanggil sebelum metode ReadBarCodes().
public void SetBarCodeImage(Bitmap value)
Parameter | Jenis | Keterangan |
---|---|---|
value | Bitmap | Gambar bitmap untuk pengenalan. |
Contoh
Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.
[C#]
using (Bitmap bmp = new Bitmap(@"c:\test.png"))
using (BarCodeReader reader = new BarCodeReader())
{
reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128);
reader.SetBarCodeImage(bmp);
foreach (BarCodeResult result in reader.ReadBarCodes())
{
Console.WriteLine("BarCode Type: " + result.CodeTypeName);
Console.WriteLine("BarCode CodeText: " + result.CodeText);
}
}
[VB.NET]
Using bmp = New Bitmap("c:\test.png")
Using reader As New BarCodeReader()
reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128)
reader.SetBarCodeImage(bmp)
For Each result As BarCodeResult In reader.ReadBarCodes()
Console.WriteLine("BarCode Type: " + result.CodeTypeName)
Console.WriteLine("BarCode CodeText: " + result.CodeText)
Next
End Using
End Using
Lihat juga
- class BarCodeReader
- ruang nama Aspose.BarCode.BarCodeRecognition
- perakitan Aspose.BarCode
SetBarCodeImage(Bitmap, Rectangle[])
Mengatur gambar bitmap dan area untuk dikenali. Harus dipanggil sebelum metode ReadBarCodes().
public void SetBarCodeImage(Bitmap value, Rectangle[] areas)
Parameter | Jenis | Keterangan |
---|---|---|
value | Bitmap | Gambar bitmap untuk pengenalan. |
areas | Rectangle[] | daftar area untuk pengakuan |
Contoh
Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.
[C#]
using (Bitmap bmp = new Bitmap(@"c:\test.png"))
using (BarCodeReader reader = new BarCodeReader())
{
reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128);
reader.SetBarCodeImage(bmp, new Rectangle[] { new Rectangle(0, 0, bmp.Width, bmp.Height) });
foreach (BarCodeResult result in reader.ReadBarCodes())
{
Console.WriteLine("BarCode Type: " + result.CodeTypeName);
Console.WriteLine("BarCode CodeText: " + result.CodeText);
}
}
[VB.NET]
Using bmp = New Bitmap("c:\test.png")
Using reader As New BarCodeReader()
reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128)
reader.SetBarCodeImage(bmp, New Rectangle() {New Rectangle(0, 0, bmp.Width, bmp.Height)})
For Each result As BarCodeResult In reader.ReadBarCodes()
Console.WriteLine("BarCode Type: " + result.CodeTypeName)
Console.WriteLine("BarCode CodeText: " + result.CodeText)
Next
End Using
End Using
Lihat juga
- class BarCodeReader
- ruang nama Aspose.BarCode.BarCodeRecognition
- perakitan Aspose.BarCode
SetBarCodeImage(Bitmap, Rectangle)
Mengatur gambar bitmap dan area untuk pengenalan. Harus dipanggil sebelum metode ReadBarCodes().
public void SetBarCodeImage(Bitmap value, Rectangle area)
Parameter | Jenis | Keterangan |
---|---|---|
value | Bitmap | Gambar bitmap untuk pengenalan. |
area | Rectangle | daerah untuk pengakuan |
Contoh
Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.
[C#]
using (Bitmap bmp = new Bitmap(@"c:\test.png"))
using (BarCodeReader reader = new BarCodeReader())
{
reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128);
reader.SetBarCodeImage(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height));
foreach (BarCodeResult result in reader.ReadBarCodes())
{
Console.WriteLine("BarCode Type: " + result.CodeTypeName);
Console.WriteLine("BarCode CodeText: " + result.CodeText);
}
}
[VB.NET]
Using bmp = New Bitmap("c:\test.png")
Using reader As New BarCodeReader()
reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128)
reader.SetBarCodeImage(bmp, New Rectangle(0, 0, bmp.Width, bmp.Height))
For Each result As BarCodeResult In reader.ReadBarCodes()
Console.WriteLine("BarCode Type: " + result.CodeTypeName)
Console.WriteLine("BarCode CodeText: " + result.CodeText)
Next
End Using
End Using
Lihat juga
- class BarCodeReader
- ruang nama Aspose.BarCode.BarCodeRecognition
- perakitan Aspose.BarCode
SetBarCodeImage(string)
Mengatur file gambar untuk dikenali. Harus dipanggil sebelum metode ReadBarCodes().
public void SetBarCodeImage(string filename)
Parameter | Jenis | Keterangan |
---|---|---|
filename | String | File gambar untuk pengenalan. |
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 BarCodeReader
- ruang nama Aspose.BarCode.BarCodeRecognition
- perakitan Aspose.BarCode
SetBarCodeImage(Stream)
Mengatur aliran gambar untuk pengenalan. Harus dipanggil sebelum metode ReadBarCodes().
public void SetBarCodeImage(Stream stream)
Parameter | Jenis | Keterangan |
---|---|---|
stream | Stream | Aliran gambar untuk pengenalan. |
Contoh
Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.
[C#]
using (FileStream fstr = new FileStream(@"c:\test.png", FileMode.Open))
using (BarCodeReader reader = new BarCodeReader())
{
reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128);
reader.SetBarCodeImage(fstr);
foreach (BarCodeResult result in reader.ReadBarCodes())
{
Console.WriteLine("BarCode Type: " + result.CodeTypeName);
Console.WriteLine("BarCode CodeText: " + result.CodeText);
}
}
[VB.NET]
Using fstr = New FileStream("c:\test.png", FileMode.Open)
Using reader As New BarCodeReader()
reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128)
reader.SetBarCodeImage(fstr)
For Each result As BarCodeResult In reader.ReadBarCodes()
Console.WriteLine("BarCode Type: " + result.CodeTypeName)
Console.WriteLine("BarCode CodeText: " + result.CodeText)
Next
End Using
End Using
Lihat juga
- class BarCodeReader
- ruang nama Aspose.BarCode.BarCodeRecognition
- perakitan Aspose.BarCode