QualitySettings

BarCodeReader.QualitySettings property

QualitySettings memungkinkan untuk mengonfigurasi kualitas dan kecepatan pengenalan secara manual. Anda dapat dengan cepat mengatur QualitySettings dengan preset tertanam: HighPerformance, NormalQuality, HighQuality, MaxBarCodes atau Anda dapat mengonfigurasi opsi terpisah secara manual. Nilai default QualitySettings adalah NormalQuality.

public QualitySettings QualitySettings { get; set; }

Nilai properti

Pengaturan Kualitas untuk mengonfigurasi kualitas dan kecepatan pengenalan.

Contoh

Contoh ini menunjukkan cara menggunakan QualitySettings dengan BarCodeReader

[C#]
using (BarCodeReader reader = new BarCodeReader(@"c:\test.png", DecodeType.Code39Standard, DecodeType.Code128))
{
   // atur mode kinerja tinggi
   reader.QualitySettings = QualitySettings.HighPerformance;
   foreach (BarCodeResult result in reader.ReadBarCodes())
      Console.WriteLine("BarCode CodeText: " + result.CodeText);
}
using (BarCodeReader reader = new BarCodeReader(@"c:\test.png", DecodeType.Code39Standard, DecodeType.Code128))
{
   // mode kualitas normal diatur secara default
   foreach (BarCodeResult result in reader.ReadBarCodes())
      Console.WriteLine("BarCode CodeText: " + result.CodeText);
}
using (BarCodeReader reader = new BarCodeReader(@"c:\test.png", DecodeType.Code39Standard, DecodeType.Code128))
{
   // atur mode kinerja tinggi
   reader.QualitySettings = QualitySettings.HighPerformance;
   // atur opsi terpisah
   reader.QualitySettings.AllowMedianSmoothing = true;
   reader.QualitySettings.MedianSmoothingWindowSize = 5;
   foreach (BarCodeResult result in reader.ReadBarCodes())
      Console.WriteLine("BarCode CodeText: " + result.CodeText);
}
[VB.NET]
Using reader As New BarCodeReader("c:\test.png", DecodeType.Code39Standard, DecodeType.Code128)
    'mengatur mode kinerja tinggi
    reader.QualitySettings = QualitySettings.HighPerformance
    For Each result As BarCodeResult In reader.ReadBarCodes()
        Console.WriteLine("BarCode Type: " + result.CodeTypeName)
    Next
End Using
Using reader As New BarCodeReader("c:\test.png", DecodeType.Code39Standard, DecodeType.Code128)
    'mode kualitas normal diatur secara default
    For Each result As BarCodeResult In reader.ReadBarCodes()
        Console.WriteLine("BarCode Type: " + result.CodeTypeName)
    Next
End Using
Using reader As New BarCodeReader("c:\test.png", DecodeType.Code39Standard, DecodeType.Code128)
   'mengatur mode kinerja tinggi
   reader.QualitySettings = QualitySettings.HighPerformance
   'mengatur pilihan terpisah
   reader.QualitySettings.AllowMedianSmoothing = True
   reader.QualitySettings.MedianSmoothingWindowSize = 5
   For Each result As BarCodeResult In reader.ReadBarCodes()
       Console.WriteLine("BarCode Type: " + result.CodeTypeName)
   Next
End Using

Lihat juga