Enum QREncodeMode

Enum QREncodeMode

名称: Aspose.BarCode.Generation 聚集: Aspose.BarCode.dll (25.4.0)

加密模式为QR条码。

public enum QREncodeMode

Fields

Auto = 0

在自动模式下,CodeText以最大数据复制性编码。Unicode 字符在可能的情况下在 kanji 模式下加密,或者在 ECIEincoding 指定的加密中重新加密,并输入 ECI 识别器。如果发现未受选 ECI 编码支持的字符,则将排除一个例外。

Binary = 7

在二进制模式中,CodeText 以最大数据复制性编码。如果一个 Unicode 字符被发现,则被扔出一个例外。

Bytes = 1

如果它检测到任何 Unicode 字符,字符将被编码为两个字符,较低的字符首先。

ECI = 8

在 ECI 模式下,整个消息在 ECIE 编码所指定的编码中重新编码,并将 ECI 识别器插入。如果发现未受选 ECI 编码支持的字符,则将排除一个例外。请注意,一些旧(2006年之前)的扫描仪可能不支持此模式。此模式不受 MicroQR 条形码支持。

ECIEncoding = 4

在 ECIE 编码属性中编码代码文本与值设置. 一些旧(2006 年之前)条码扫描器可能有问题。此模式不受 MicroQR 条形码支持。

Extended = 6

扩展频道模式支持 FNC1 第一位、 FNC1 第二位和多 ECI 模式。

最好使用 QrExtCodetextBuilder 用于扩展代码生成。

使用 Display2DText 属性设置可见文本以删除管理字符。

编码原则:

所有符号“\”必须在代码文本中加倍“\”。

第一位的 FNC1 在代码文本中设置为“

第二位的FNC1在代码文本中设置为“<FNC1(值)>”。值必须是单个符号(a-z,A-Z)或数字从0到99。

FNC1 模式的组分离器设置为 0x1D 字符 ‘\u001D’

如果您需要将“”字符串输入到条码中,请将其写作为“ <\F NC1 >”

ECI 标识符设置为单数和六个数字标识符“\000026” - UTF8 ECI 标识符

要禁用现行 ECI 模式并转换为默认 JIS8 模式零模式,设置了 ECI indetifier。

在 ECI 识别后,所有 Unicode 字符都会自动编码到正确的字符代码。

此模式不受 MicroQR 条形码支持。

ExtendedCodetext = 5

扩展频道模式支持 FNC1 第一位、 FNC1 第二位和多 ECI 模式。

最好使用 QrExtCodetextBuilder 用于扩展代码生成。

使用 Display2DText 属性设置可见文本以删除管理字符。

编码原则:

所有符号“\”必须在代码文本中加倍“\”。

第一位的 FNC1 在代码文本中设置为“

第二位的FNC1在代码文本中设置为“<FNC1(值)>”。值必须是单个符号(a-z,A-Z)或数字从0到99。

FNC1 模式的组分离器设置为 0x1D 字符 ‘\u001D’

如果您需要将“”字符串输入到条码中,请将其写作为“ <\F NC1 >”

ECI 标识符设置为单数和六个数字标识符“\000026” - UTF8 ECI 标识符

要禁用现行 ECI 模式并转换为默认 JIS8 模式零模式,设置了 ECI indetifier。

在 ECI 识别后,所有 Unicode 字符都会自动编码到正确的字符代码。

此模式不受 MicroQR 条形码支持。

Utf16BEBOM = 3

使用 UTF8 编码的代码文本与第一个 ByteOfMark 字符。

Utf8BOM = 2

使用 UTF8 编码的代码文本与第一个 ByteOfMark 字符。

Examples

这些样本显示如何通过扩展数据格式编码和保存QR条码。

//This sample shows how to use ECI encoding and save a BarCode image.

[C#]
using (Aspose.BarCode.Generation.BarcodeGenerator generator = new Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.QR))
{
    generator.CodeText = "12345TEXT";
    generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.ECIEncoding;
    generator.Parameters.Barcode.QR.QrECIEncoding = ECIEncodings.UTF8;
    generator.Save("test.png");
}
Using generator As New Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.QR)
    generator.CodeText = "12345TEXT"
    generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.ECIEncoding
    generator.Parameters.Barcode.QR.QrECIEncoding = ECIEncodings.UTF8
    generator.Save("test.png")
End Using

//This sample shows how to use FNC1 first position in Extended Mode.

//Extended Channel mode which supports FNC1 first position, FNC1 second position and multi ECI modes.
//It is better to use QrExtCodetextBuilder for extended codetext generation.
//Use Display2DText property to set visible text to removing managing characters.
//Encoding Principles:
//All symbols "\" must be doubled "\\" in the codetext.
//FNC1 in first position is set in codetext as as "&lt;FNC1&gt;"
//FNC1 in second position is set in codetext as as "&lt;FNC1(value)&gt;". The value must be single symbols (a-z, A-Z) or digits from 0 to 99.
//Group Separator for FNC1 modes is set as 0x1D character '\\u001D'
//If you need to insert "&lt;FNC1&gt;" string into barcode write it as "&lt;\FNC1&gt;"
//ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
//To disable current ECI mode and convert to default JIS8 mode zero mode ECI indetifier is set. "\000000"
//All unicode characters after ECI identifier are automatically encoded into correct character codeset.

[C#]
//create codetext
QrExtCodetextBuilder textBuilder = new QrExtCodetextBuilder();
textBuilder.AddFNC1FirstPosition();
textBuilder.AddPlainCodetext("000%89%%0");
textBuilder.AddFNC1GroupSeparator();
textBuilder.AddPlainCodetext("12345&lt;FNC1&gt;");
//generate barcode
using (Aspose.BarCode.Generation.BarcodeGenerator generator = new Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.QR))
{
    generator.CodeText = textBuilder.GetExtendedCodetext();
    generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.Extended;
    generator.Parameters.Barcode.CodeTextParameters.TwoDDisplayText = "My Text";
    generator.Save(@"d:\test.png");
}
'create codetext
Dim textBuilder As New QrExtCodetextBuilder()
textBuilder.AddFNC1FirstPosition()
textBuilder.AddPlainCodetext("000%89%%0")
textBuilder.AddFNC1GroupSeparator()
textBuilder.AddPlainCodetext("12345&lt;FNC1&gt;")
'generate barcode
Using generator As New Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.QR)
    generator.CodeText = textBuilder.GetExtendedCodetext()
    generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.Extended
    generator.Parameters.Barcode.CodeTextParameters.TwoDDisplayText = "My Text"
    generator.Save("test.png")
End Using

//This sample shows how to use FNC1 second position in Extended Mode.

[C#]
//create codetext
QrExtCodetextBuilder textBuilder = new QrExtCodetextBuilder();
textBuilder.AddFNC1SecondPosition("12");
textBuilder.AddPlainCodetext("TRUE3456"); 
//generate barcode
using (Aspose.BarCode.Generation.BarcodeGenerator generator = new Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.QR))
{
    generator.CodeText = textBuilder.GetExtendedCodetext();
    generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.Extended;
    generator.Parameters.Barcode.CodeTextParameters.TwoDDisplayText = "My Text";
    generator.Save(@"d:\test.png");
}
'create codetext
Dim textBuilder As New QrExtCodetextBuilder()
textBuilder.AddFNC1SecondPosition("12")
textBuilder.AddPlainCodetext("TRUE3456")
'generate barcode
Using generator As New Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.QR)
    generator.CodeText = textBuilder.GetExtendedCodetext()
    generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.Extended
    generator.Parameters.Barcode.CodeTextParameters.TwoDDisplayText = "My Text"
    generator.Save("test.png")
End Using

//This sample shows how to use multi ECI mode in Extended Mode.

[C#]
//create codetext
QrExtCodetextBuilder textBuilder = new QrExtCodetextBuilder();
textBuilder.AddECICodetext(ECIEncodings.Win1251, "Will");
textBuilder.AddECICodetext(ECIEncodings.UTF8, "Right");
textBuilder.AddECICodetext(ECIEncodings.UTF16BE, "Power");
textBuilder.AddPlainCodetext(@"t\e\\st");   
//generate barcode
using (Aspose.BarCode.Generation.BarcodeGenerator generator = new Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.QR))
{
    generator.CodeText = textBuilder.GetExtendedCodetext();
    generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.Extendedt;
    generator.Parameters.Barcode.CodeTextParameters.TwoDDisplayText = "My Text";
    generator.Save(@"d:\test.png");
}
'create codetext
Dim textBuilder As New QrExtCodetextBuilder()
textBuilder.AddECICodetext(ECIEncodings.Win1251, "Will")
textBuilder.AddECICodetext(ECIEncodings.UTF8, "Right")
textBuilder.AddECICodetext(ECIEncodings.UTF16BE, "Power")
textBuilder.AddPlainCodetext(@"t\e\\st") 
'generate barcode
Using generator As New Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.QR)
    generator.CodeText = textBuilder.GetExtendedCodetext()
    generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.Extended
    generator.Parameters.Barcode.CodeTextParameters.TwoDDisplayText = "My Text"
    generator.Save("test.png")
End Using
 中文