QuietZone Свойство (ISO15415QualityTest)
В этом разделе
Возвращает неактивную зону штрих-кода в процентах, что требуется спецификацией символики штрих-кода.
Синтаксис
Ремарки
Тихая зона - это необязательный параметр, который может быть полезным инструментом управления процессом для проверки тихой зоны, требуемой спецификацией символики штрих-кода. Тихая зона не влияет на общую оценку.
Размер тихой зоны можно изменить с помощью метода SetQuietZoneSize(BarcodeType,Int32).
Пример
Вот пример, который демонстрирует как проверить "тихую зону" 2D-штрих-кода:
Imports Vintasoft.Barcode
Imports Vintasoft.Barcode.QualityTests
Public Class ISO15415QualityTestQuietZoneExample
''' <summary>
''' Prints the information about quiet zone of 2D barcode.
''' </summary>
''' <param name="filename">The filename.</param>
''' <param name="barcodeType">Type of the barcode.</param>
Public Shared Sub PrintQuietZoneInfo2D(filename As String, barcodeType As BarcodeType)
Using qualityTestManager As New QualityTestManager(barcodeType)
' recognize barcodes and execute testing for recognized barcodes
qualityTestManager.ExecuteTesting(filename)
' for each recognized barcode
For Each qualityTest As ISO15415QualityTest In qualityTestManager.ISO15415Results
' print the quality test information
Console.WriteLine("Barcode Type: {0}", qualityTest.BarcodeInfo.BarcodeType)
Console.WriteLine("Required Quiet Zone: {0}X", qualityTest.QuietZoneSize)
Console.WriteLine("Barcode value: {0}", qualityTest.BarcodeInfo.Value)
Console.WriteLine("Quiet Zone: {0}%", Math.Round(qualityTest.QuietZone.Value, 1))
Next
End Using
End Sub
End Class
using System;
using Vintasoft.Barcode;
using Vintasoft.Barcode.QualityTests;
public class ISO15415QualityTestQuietZoneExample
{
/// <summary>
/// Prints the information about quiet zone of 2D barcode.
/// </summary>
/// <param name="filename">The filename.</param>
/// <param name="barcodeType">Type of the barcode.</param>
public static void PrintQuietZoneInfo2D(string filename, BarcodeType barcodeType)
{
using (QualityTestManager qualityTestManager = new QualityTestManager(barcodeType))
{
// recognize barcodes and execute testing for recognized barcodes
qualityTestManager.ExecuteTesting(filename);
// for each recognized barcode
foreach (ISO15415QualityTest qualityTest in qualityTestManager.ISO15415Results)
{
// print the quality test information
Console.WriteLine("Barcode Type: {0}", qualityTest.BarcodeInfo.BarcodeType);
Console.WriteLine("Required Quiet Zone: {0}X", qualityTest.QuietZoneSize);
Console.WriteLine("Barcode value: {0}", qualityTest.BarcodeInfo.Value);
Console.WriteLine("Quiet Zone: {0}%", Math.Round(qualityTest.QuietZone.Value, 1));
}
}
}
}
Требования
Целевые платформы: .NET 11; .NET 10; .NET 9; .NET 8; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5
Смотрите также