VintaSoft Barcode .NET SDK 15.3: Documentation for .NET developer
Vintasoft.Barcode.QualityTests Namespace / ISO15415QualityTestManager Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
    ISO15415QualityTestManager Class
    In This Topic
    Provides the manager of ISO/IEC 15415 barcode print quality test for 2D barcodes.
    Object Model
    ISO15415QualityTestSettings BarcodeReader ISO15415QualityTestManager
    Syntax
    'Declaration
    
    Public Class ISO15415QualityTestManager
    
    
    public class ISO15415QualityTestManager
    
    
    public __gc class ISO15415QualityTestManager
    
    
    public ref class ISO15415QualityTestManager
    
    
    Example

    Here is an example that demonstrates how to test print quality of 2D barcodes:

       
       
    Imports System.IO   
       
    Imports Vintasoft.Barcode   
    Imports Vintasoft.Barcode.QualityTests   
       
    ''' <summary>
    ''' Shows how to test print quality of 2D barcodes using ISO15415QualityTestManger class.
    ''' </summary>
    Class ISO15415QualityTestManagerExample   
        ''' <summary>
        ''' Runs the quality test.
        ''' </summary>
        Public Shared Sub Test(barcode As BarcodeType, files As String())   
            Using testManager As New ISO15415QualityTestManager(barcode)   
                ' apertue factor = 0.8
                testManager.ApertureFactor = 0.8   
       
                ' barcode cell size (pixels) = undefined
                testManager.BarcodeCellAvgSize = 0   
       
                For Each file As String In files   
                    Console.Write(Path.GetFileName(file) & ": ")   
                    Dim results As ISO15415QualityTest() = testManager.ExecuteTest(file)   
       
                    If results.Length > 1 Then   
                        Throw New Exception("Unexpected barcode count.")   
                    End If   
       
                    If results.Length = 0 Then   
                        Console.WriteLine("No barcode found.")   
                    Else   
                        Dim result As ISO15415QualityTest = results(0)   
                        Console.Write("Found = " & result.BarcodeInfo.Value & "; ")   
                        Console.WriteLine("Scan Grade = " & GradeToString(result.ScanGrade))   
                    End If   
                Next   
            End Using   
        End Sub   
       
        ''' <summary>
        ''' Converts ISO15415 quality grade into string value.
        ''' </summary>
        Private Shared Function GradeToString(grade As ISO15415QualityGrade) As String   
            Return String.Format("{0}({1})", CInt(grade).ToString(), grade)   
        End Function   
    End Class
    
    
    
    using System;
    
    using System.IO;
    
    using Vintasoft.Barcode;
    using Vintasoft.Barcode.QualityTests;
    
    /// <summary>
    /// Shows how to test print quality of 2D barcodes using ISO15415QualityTestManger class.
    /// </summary>
    class ISO15415QualityTestManagerExample
    {
        /// <summary>
        /// Runs the quality test.
        /// </summary>
        public static void Test(BarcodeType barcode, string[] files)
        {
            using (ISO15415QualityTestManager testManager = new ISO15415QualityTestManager(barcode))
            {
                // apertue factor = 0.8
                testManager.ApertureFactor = 0.8;
                
                // barcode cell size (pixels) = undefined
                testManager.BarcodeCellAvgSize = 0;
                
                foreach (string file in files)
                {
                    Console.Write(Path.GetFileName(file) + ": ");
                    ISO15415QualityTest[] results = testManager.ExecuteTest(file);
                    
                    if (results.Length > 1)
                        throw new Exception("Unexpected barcode count.");
    
                    if (results.Length == 0)
                    {
                        Console.WriteLine("No barcode found.");
                    }
                    else
                    {
                        ISO15415QualityTest result = results[0];
                        Console.Write("Found = " + result.BarcodeInfo.Value + "; ");
                        Console.WriteLine("Scan Grade = " + GradeToString(result.ScanGrade));
                    }
                }
            }
        }    
       
        /// <summary>
        /// Converts ISO15415 quality grade into string value.
        /// </summary>
        private static string GradeToString(ISO15415QualityGrade grade)
        {
            return string.Format("{0}({1})", ((int)grade).ToString(), grade);
        }
    }
    
    

    Inheritance Hierarchy

    System.Object
       Vintasoft.Barcode.QualityTests.ISO15415QualityTestManager

    Requirements

    Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also