BarCodeReader

BarCodeReader()

Menginisialisasi instance baru dariBarCodeReader kelas dengan nilai default. Diperlukan untuk menyetel gambar (SetBitmapImage()) sebelum memanggil metode ReadBarCodes().

public BarCodeReader()

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


BarCodeReader(Bitmap)

Menginisialisasi instance baru dariBarCodeReader kelas dari gambar.

public BarCodeReader(Bitmap image)
ParameterJenisKeterangan
imageBitmapContoh Bitmap yang berisi gambar

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (Bitmap bmp = new Bitmap(@"c:\test.png"))
using (BarCodeReader reader = new BarCodeReader(bmp))
{
    reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128);
    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(bmp)
        reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128)
        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


BarCodeReader(Bitmap, params BaseDecodeType[])

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(Bitmap image, params BaseDecodeType[] decodeTypes)
ParameterJenisKeterangan
imageBitmapFoto.
decodeTypesBaseDecodeType[]Jenis dekode.

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (Bitmap bmp = new Bitmap(@"c:\test.png"))
using (BarCodeReader reader = new BarCodeReader(bmp, DecodeType.Code39Standard, DecodeType.Code128))
{
    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(bmp, DecodeType.Code39Standard, DecodeType.Code128)
        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


BarCodeReader(Bitmap, BaseDecodeType)

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(Bitmap image, BaseDecodeType type)
ParameterJenisKeterangan
imageBitmapFoto.
typeBaseDecodeTypeJenis dekode1. Itu bisa tunggal atau banyak

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (Bitmap bmp = new Bitmap(@"c:\test.png"))
using (BarCodeReader reader = new BarCodeReader(bmp, new MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128))
{
    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(bmp, New MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128))
        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


BarCodeReader(Bitmap, Rectangle, params BaseDecodeType[])

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(Bitmap image, Rectangle area, params BaseDecodeType[] decodeTypes)
ParameterJenisKeterangan
imageBitmapFoto.
areaRectangleArea untuk pengakuan.
decodeTypesBaseDecodeType[]Jenis dekode.

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (Bitmap bmp = new Bitmap(@"c:\test.png"))
using (BarCodeReader reader = new BarCodeReader(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height), DecodeType.Code39Standard, DecodeType.Code128)
{
    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(bmp, New Rectangle(0, 0, bmp.Width, bmp.Height), DecodeType.Code39Standard, DecodeType.Code128)
        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


BarCodeReader(Bitmap, Rectangle, BaseDecodeType)

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(Bitmap image, Rectangle area, BaseDecodeType type)
ParameterJenisKeterangan
imageBitmapFoto.
areaRectangleArea untuk pengakuan.
typeBaseDecodeTypeJenis dekode.

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (Bitmap bmp = new Bitmap(@"c:\test.png"))
using (BarCodeReader reader = new BarCodeReader(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height), new MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128))
{
    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(bmp, New Rectangle(0, 0, bmp.Width, bmp.Height), New MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128))
        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


BarCodeReader(Bitmap, Rectangle[], params BaseDecodeType[])

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(Bitmap image, Rectangle[] areas, params BaseDecodeType[] decodeTypes)
ParameterJenisKeterangan
imageBitmapGambar untuk dibaca
areasRectangle[]Array area pengenalan
decodeTypesBaseDecodeType[]Jenis dekode berlaku untuk semua area yang ditentukan.

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (Bitmap bmp = new Bitmap(@"c:\test.png"))
using (BarCodeReader reader = new BarCodeReader(bmp, new Rectangle[] { new Rectangle(0, 0, bmp.Width, bmp.Height) }, DecodeType.Code39Standard, DecodeType.Code128)
{
    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(bmp, New Rectangle() {New Rectangle(0, 0, bmp.Width, bmp.Height)}, DecodeType.Code39Standard, DecodeType.Code128)
        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


BarCodeReader(Bitmap, Rectangle[], BaseDecodeType)

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(Bitmap image, Rectangle[] areas, BaseDecodeType type)
ParameterJenisKeterangan
imageBitmapGambar untuk dibaca
areasRectangle[]Array area pengenalan
typeBaseDecodeTypeJenis dekode berlaku untuk semua area yang ditentukan.

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (Bitmap bmp = new Bitmap(@"c:\test.png"))
using (BarCodeReader reader = new BarCodeReader(bmp, new Rectangle[] { new Rectangle(0, 0, bmp.Width, bmp.Height) }, new MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128))
{
    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(bmp, New Rectangle() {New Rectangle(0, 0, bmp.Width, bmp.Height)}, New MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128))
        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


BarCodeReader(string)

Menginisialisasi instance baru dariBarCodeReader kelas dari file.

public BarCodeReader(string filename)
ParameterJenisKeterangan
filenameStringNama file.

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (BarCodeReader reader = new BarCodeReader(@"c:\test.png"))
{
    reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128);
    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("c:\test.png")
    reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128)
    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


BarCodeReader(string, params BaseDecodeType[])

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(string filename, params BaseDecodeType[] decodeTypes)
ParameterJenisKeterangan
filenameStringNama file.
decodeTypesBaseDecodeType[]Jenis dekode.

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
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);
    }
}
[VB.NET]
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)
    Next
End Using

Lihat juga


BarCodeReader(string, BaseDecodeType)

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(string filename, BaseDecodeType type)
ParameterJenisKeterangan
filenameStringNama file.
typeBaseDecodeTypeJenis dekode.

Contoh

Contoh ini menunjukkan cara mendeteksi barcode Code39 dan Code128.

[C#]
using (BarCodeReader reader = new BarCodeReader(@"c:\test.png", new MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128)))
{
    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("c:\test.png", New MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128))
    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


BarCodeReader(Stream)

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(Stream stream)
ParameterJenisKeterangan
streamStreamAliran.

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(fstr))
{
    reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128);
    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(fstr)
        reader.SetBarCodeReadType(DecodeType.Code39Standard, DecodeType.Code128)
        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


BarCodeReader(Stream, BaseDecodeType)

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(Stream stream, BaseDecodeType type)
ParameterJenisKeterangan
streamStreamAliran.
typeBaseDecodeTypeJenis dekode.

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(fstr, new MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128)))
{
    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(fstr, New MultyDecodeType(DecodeType.Code39Standard, DecodeType.Code128))
        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


BarCodeReader(Stream, params BaseDecodeType[])

Menginisialisasi instance baru dariBarCodeReader kelas.

public BarCodeReader(Stream stream, params BaseDecodeType[] decodeTypes)
ParameterJenisKeterangan
streamStreamAliran.
decodeTypesBaseDecodeType[]Jenis dekode.

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(fstr, DecodeType.Code39Standard, DecodeType.Code128))
{
    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(fstr, DecodeType.Code39Standard, DecodeType.Code128)
        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