VintaSoft Barcode .NET SDK 15.0: Руководство для .NET разработчика
Vintasoft.Barcode.SymbologySubsets Namespace / BarcodeSymbologySubsets Class
Члены типа Объект Синтаксис Example Иерархия Требования Смотрите также
В этом разделе
    Класс BarcodeSymbologySubsets
    В этом разделе
    Содержит подмножества стандартных символов штрих-кода.
    Объектная модель
    GS1AztecBarcodeSymbology GS1_128BarcodeSymbology GS1_128CCABarcodeSymbology GS1_128CCBBarcodeSymbology GS1_128CCCBarcodeSymbology Sscc18BarcodeSymbology FedExGround96BarcodeSymbology VicsBolBarcodeSymbology VicsScacProBarcodeSymbology EAN13CCABarcodeSymbology EAN13CCBBarcodeSymbology EAN8CCABarcodeSymbology EAN8CCBBarcodeSymbology UPCACCABarcodeSymbology UPCACCBBarcodeSymbology UPCECCABarcodeSymbology UPCECCBBarcodeSymbology GS1DataBarBarcodeSymbology GS1DataBarCCABarcodeSymbology GS1DataBarCCBBarcodeSymbology Itf14BarcodeSymbology GS1DataBarStackedBarcodeSymbology GS1DataBarStackedCCABarcodeSymbology GS1DataBarStackedCCBBarcodeSymbology GS1DataBarExpandedBarcodeSymbology GS1DataBarExpandedCCABarcodeSymbology GS1DataBarExpandedCCBBarcodeSymbology GS1DataBarExpandedStackedBarcodeSymbology GS1DataBarExpandedStackedCCABarcodeSymbology GS1DataBarExpandedStackedCCBBarcodeSymbology GS1DataBarLimitedBarcodeSymbology GS1DataBarLimitedCCABarcodeSymbology GS1DataBarLimitedCCBBarcodeSymbology GS1QRBarcodeSymbology GS1DataMatrixBarcodeSymbology GS1DotCodeBarcodeSymbology MailmarkCmdmType7BarcodeSymbology MailmarkCmdmType9BarcodeSymbology MailmarkCmdmType29BarcodeSymbology Interleaved2of5ChecksumISO16390 Interleaved2of5ChecksumMod10C ItalianPost2of5 Code32BarcodeSymbology VinSymbology PznBarcodeSymbology DhlAwbBarcodeSymbology Code39ExtendedBarcodeSymbology OpcBarcodeSymbology DeutschePostIdentcodeBarcodeSymbology DeutschePostLeitcodeBarcodeSymbology Jan13BarcodeSymbology Jan13Plus5BarcodeSymbology Jan13Plus2BarcodeSymbology Jan8BarcodeSymbology Jan8Plus5BarcodeSymbology Jan8Plus2BarcodeSymbology IsbnBarcodeSymbology IsbnPlus2BarcodeSymbology IsbnPlus5BarcodeSymbology IsmnBarcodeSymbology IsmnPlus2BarcodeSymbology IsmnPlus5BarcodeSymbology IssnBarcodeSymbology IssnPlus2BarcodeSymbology IssnPlus5BarcodeSymbology SwissPostParcelBarcodeSymbology PpnBarcodeSymbology EanVelocityBarcodeSymbology NumlyNumberBarcodeSymbology XFACompressedPDF417BarcodeSymbology XFACompressedDataMatrixBarcodeSymbology XFACompressedAztecBarcodeSymbology XFACompressedQRCodeBarcodeSymbology AamvaBarcodeSymbology Isbt128BarcodeSymbology Isbt128DataMatrixBarcodeSymbology HibcLic128BarcodeSymbology HibcLic39BarcodeSymbology HibcLicQRBarcodeSymbology HibcLicAztecBarcodeSymbology HibcLicDataMatrixBarcodeSymbology SwissQRCodeBarcodeSymbology BarcodeSymbologySubsets
    Синтаксис
    'Declaration
    
    Public MustInherit NotInheritable Class BarcodeSymbologySubsets
    
    
    public static class BarcodeSymbologySubsets
    
    
    public __gc abstract __sealed class BarcodeSymbologySubsets
    
    
    public ref class BarcodeSymbologySubsets abstract sealed
    
    
    Пример

    Распознавание подмножеств штрих-кодов: см. пример здесь.
    Генерация подмножеств штрих-кодов: см. пример здесь.
    Распознавание и генерация штрих-кода PPN: см. пример здесь.

    Этот код C#/VB.NET показывает, как распознать штрих-код GS1-128 в изображении:

       
    ''' <summary>
    ''' Recognizes GS1-128 barcodes in specified image.
    ''' </summary>
    ''' <param name="filename">The filename of image file with barcodes.</param>
    Public Shared Sub Recognize(filename As String)   
        ' create the barcode reader
        Using reader As New BarcodeReader()   
            ' specify that reader must search for GS1-128 barcodes only
       
            reader.Settings.ScanBarcodeTypes = BarcodeType.None   
            reader.Settings.ScanBarcodeSubsets.Add(BarcodeSymbologySubsets.GS1_128)   
       
            ' recognize barcodes in image
            Dim infos As IBarcodeInfo() = reader.ReadBarcodes(filename)   
       
            ' for each found barcode
            For j As Integer = 0 To infos.Length - 1   
                Dim info As GS1BarcodeInfo = DirectCast(infos(j), GS1BarcodeInfo)   
       
                ' print barcode symbology
                Console.WriteLine(info.BarcodeSubset)   
       
                ' print barcode region on image
                Console.WriteLine(info.Region.ToString())   
       
                ' print Transmitted data
                Console.WriteLine(String.Format("Transmitted data            : {0} ", info.TransmittedData))   
       
                ' print values of Application identifiers
                Dim printableValue As New StringBuilder()   
                Dim aiValues As GS1ApplicationIdentifierValue() = info.ApplicationIdentifierValues   
                For i As Integer = 0 To aiValues.Length - 1   
                    Dim aiValue As GS1ApplicationIdentifierValue = aiValues(i)   
                    Dim ai As GS1ApplicationIdentifier = aiValue.ApplicationIdentifier   
                    Console.WriteLine(String.Format("Application identifier {0}    : {1}", i + 1, ai.ApplicationIdentifier))   
                    Console.WriteLine(String.Format("  Value                     : {0}", aiValue.Value))   
                    Console.WriteLine(String.Format("  Data title                : {0}", ai.DataTitle))   
                    Console.WriteLine(String.Format("  Data content              : {0}", ai.DataContent))   
                    Console.WriteLine(String.Format("  Format                    : {0}", ai.Format))   
                    Console.WriteLine(String.Format("  Is contains decimal point : {0}", ai.IsContainsDecimalPoint))   
                    Console.WriteLine(String.Format("  Is variable length        : {0}", ai.IsVariableLength))   
                    printableValue.Append(aiValue.ToString())   
                Next   
       
                ' print GS1 printable value
                Console.WriteLine("Printable GS1 value: " & printableValue.ToString())   
                Console.WriteLine()   
            Next   
        End Using   
    End Sub
    
    
    
    /// <summary>
    /// Recognizes GS1-128 barcodes in specified image.
    /// </summary>
    /// <param name="filename">The filename of image file with barcodes.</param>
    public static void Recognize(string filename)
    {
        // create the barcode reader
        using (BarcodeReader reader = new BarcodeReader())
        {
            // specify that reader must search for GS1-128 barcodes only
    
            reader.Settings.ScanBarcodeTypes = BarcodeType.None;
            reader.Settings.ScanBarcodeSubsets.Add(BarcodeSymbologySubsets.GS1_128);
    
            // recognize barcodes in image
            IBarcodeInfo[] infos = reader.ReadBarcodes(filename);
    
            // for each found barcode
            for (int j = 0; j < infos.Length; j++)
            {
                GS1BarcodeInfo info = (GS1BarcodeInfo)infos[j];
    
                // print barcode symbology
                Console.WriteLine(info.BarcodeSubset);
    
                // print barcode region on image
                Console.WriteLine(info.Region.ToString());
    
                // print Transmitted data
                Console.WriteLine(string.Format("Transmitted data            : {0} ", info.TransmittedData));
    
                // print values of Application identifiers
                StringBuilder printableValue = new StringBuilder();
                GS1ApplicationIdentifierValue[] aiValues = info.ApplicationIdentifierValues;
                for (int i = 0; i < aiValues.Length; i++)
                {
                    GS1ApplicationIdentifierValue aiValue = aiValues[i];
                    GS1ApplicationIdentifier ai = aiValue.ApplicationIdentifier;
                    Console.WriteLine(string.Format("Application identifier {0}    : {1}", i + 1, ai.ApplicationIdentifier));
                    Console.WriteLine(string.Format("  Value                     : {0}", aiValue.Value));
                    Console.WriteLine(string.Format("  Data title                : {0}", ai.DataTitle));
                    Console.WriteLine(string.Format("  Data content              : {0}", ai.DataContent));
                    Console.WriteLine(string.Format("  Format                    : {0}", ai.Format));
                    Console.WriteLine(string.Format("  Is contains decimal point : {0}", ai.IsContainsDecimalPoint));
                    Console.WriteLine(string.Format("  Is variable length        : {0}", ai.IsVariableLength));
                    printableValue.Append(aiValue.ToString());
                }
    
                // print GS1 printable value
                Console.WriteLine("Printable GS1 value: " + printableValue.ToString());
                Console.WriteLine();
            }
        }
    }
    
    

    Иерархия наследования

    System.Object
       Vintasoft.Barcode.SymbologySubsets.BarcodeSymbologySubsets

    Требования

    Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также