Class MaxiCodeCodetextMode3

Class MaxiCodeCodetextMode3

Namespace: Aspose.BarCode.ComplexBarcode
Assembly: Aspose.BarCode.dll (25.1.0)

Classe per codificare e decodificare il testo incorporato nel codice MaxiCode per le modalità 3.

public class MaxiCodeCodetextMode3 : MaxiCodeStructuredCodetext, IComplexCodetext

Ereditarietà

objectMaxiCodeCodetextMaxiCodeStructuredCodetextMaxiCodeCodetextMode3

Implementa

IComplexCodetext

Membri ereditati

MaxiCodeStructuredCodetext.GetConstructedCodetext(), MaxiCodeStructuredCodetext.InitFromString(string), MaxiCodeStructuredCodetext.Equals(object), MaxiCodeStructuredCodetext.GetHashCode(), MaxiCodeStructuredCodetext.PostalCode, MaxiCodeStructuredCodetext.CountryCode, MaxiCodeStructuredCodetext.ServiceCategory, MaxiCodeStructuredCodetext.SecondMessage, MaxiCodeCodetext.GetMode(), MaxiCodeCodetext.GetConstructedCodetext(), MaxiCodeCodetext.InitFromString(string), MaxiCodeCodetext.GetBarcodeType(), MaxiCodeCodetext.MaxiCodeEncodeMode, MaxiCodeCodetext.ECIEncoding, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Esempi

Questo esempio mostra come codificare e decodificare il testo codificato di MaxiCode per la modalità 3.

//Modalità 3 con messaggio secondario standard
MaxiCodeCodetextMode3 maxiCodeCodetext = new MaxiCodeCodetextMode3();
maxiCodeCodetext.PostalCode = "B1050";
maxiCodeCodetext.CountryCode = 056;
maxiCodeCodetext.ServiceCategory = 999;
MaxiCodeStandartSecondMessage maxiCodeStandartSecondMessage = new MaxiCodeStandartSecondMessage();
maxiCodeStandartSecondMessage.Message = "Messaggio di prova";
maxiCodeCodetext.SecondMessage = maxiCodeStandartSecondMessage;
using (ComplexBarcodeGenerator complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext))
{
    complexGenerator.GenerateBarCodeImage();
}
//Modalità 3 con messaggio secondario strutturato
MaxiCodeCodetextMode3 maxiCodeCodetext = new MaxiCodeCodetextMode3();
maxiCodeCodetext.PostalCode = "B1050";
maxiCodeCodetext.CountryCode = 056;
maxiCodeCodetext.ServiceCategory = 999;
MaxiCodeStructuredSecondMessage maxiCodeStructuredSecondMessage = new MaxiCodeStructuredSecondMessage();
maxiCodeStructuredSecondMessage.Add("634 ALPHA DRIVE");
maxiCodeStructuredSecondMessage.Add("PITTSBURGH");
maxiCodeStructuredSecondMessage.Add("PA");
maxiCodeStructuredSecondMessage.Year = 99;
maxiCodeCodetext.SecondMessage = maxiCodeStructuredSecondMessage;
using (ComplexBarcodeGenerator complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext))
{
    complexGenerator.GenerateBarCodeImage();
}
//Decodifica del testo codificato grezzo con messaggio secondario standard
using (BarCodeReader reader = new BarCodeReader(@"c:\test.png", DecodeType.MaxiCode))
{
     foreach (BarCodeResult result in reader.ReadBarCodes())
    {
        MaxiCodeCodetext resultMaxiCodeCodetext = ComplexCodetextReader.TryDecodeMaxiCode(result.Extended.MaxiCode.MaxiCodeMode, result.CodeText);
        if (resultMaxiCodeCodetext is MaxiCodeCodetextMode3){
            MaxiCodeCodetextMode3 maxiCodeStructuredCodetext = (MaxiCodeCodetextMode3)resultMaxiCodeCodetext;
            Console.WriteLine("Tipo di codice a barre: " + maxiCodeStructuredCodetext.PostalCode);
            Console.WriteLine("Modalità MaxiCode: " + maxiCodeStructuredCodetext.CountryCode);
            Console.WriteLine("Testo del codice a barre: " + maxiCodeStructuredCodetext.ServiceCategory);
            if (maxiCodeStructuredCodetext.SecondMessage is MaxiCodeStandartSecondMessage){
                MaxiCodeStandartSecondMessage secondMessage = (MaxiCodeStandartSecondMessage)maxiCodeStructuredCodetext.SecondMessage;
                Console.WriteLine("Messaggio: " + secondMessage.Message);
            }
        }
    }
}
//Decodifica del testo codificato grezzo con messaggio secondario strutturato
using (BarCodeReader reader = new BarCodeReader(@"c:\test.png", DecodeType.MaxiCode))
{
     foreach (BarCodeResult result in reader.ReadBarCodes())
    {
        MaxiCodeCodetext resultMaxiCodeCodetext = ComplexCodetextReader.TryDecodeMaxiCode(result.Extended.MaxiCode.MaxiCodeMode, result.CodeText);
        if (resultMaxiCodeCodetext is MaxiCodeCodetextMode3){
            MaxiCodeCodetextMode3 maxiCodeStructuredCodetext = (MaxiCodeCodetextMode3)resultMaxiCodeCodetext;
            Console.WriteLine("Tipo di codice a barre: " + maxiCodeStructuredCodetext.PostalCode);
            Console.WriteLine("Modalità MaxiCode: " + maxiCodeStructuredCodetext.CountryCode);
            Console.WriteLine("Testo del codice a barre: " + maxiCodeStructuredCodetext.ServiceCategory);
            if (maxiCodeStructuredCodetext.SecondMessage is MaxiCodeStructuredSecondMessage){
                MaxiCodeStructuredSecondMessage secondMessage = (MaxiCodeStructuredSecondMessage)maxiCodeStructuredCodetext.SecondMessage;
                Console.WriteLine("Messaggio:");
                foreach (var identifier in secondMessage.Identifiers){
                    Console.WriteLine(identifier);
                }
            }
        }
    }
}

Costruttori

MaxiCodeCodetextMode3()

public MaxiCodeCodetextMode3()

Metodi

GetMode()

Ottiene la modalità MaxiCode.

public override MaxiCodeMode GetMode()

Restituisce

MaxiCodeMode

Modalità MaxiCode

 Italiano