Back to Devexpress

Aztec Code

officefileapi-405179-barcode-generation-api-bar-code-types-aztec-code.md

latest1.8 KB
Original Source

Aztec Code

  • Dec 07, 2024

Aztec Code is a matrix code that has the potential to use less space than other matrix barcodes because it does not require a surrounding blank “quiet zone”. Aztec codes are widely used for transport ticketing.

Refer to the following article for more details: Aztec Code.

Use the BarCodeOptions.AztecCode property to specify options specific to the Aztec Code.

The following code creates an Aztec Code:

csharp
using DevExpress.BarCodes;
using DevExpress.Drawing;
using System.Diagnostics;

// Create an Aztec Code.
BarCode barCode = new BarCode();
barCode.Symbology = Symbology.AztecCode;
barCode.CodeText = "0123-456789";
barCode.Options.AztecCode.ErrorLevel = AztecCodeErrorLevel.Level1;
barCode.Options.AztecCode.Version = AztecCodeVersion.Version45x45;
// Save the barcode as an image.
barCode.Save("BarCodeImage.png", DXImageFormat.Png);
// Open the image in the default viewer.
Process.Start(new ProcessStartInfo("BarCodeImage.png") { UseShellExecute = true });
vb
Imports DevExpress.BarCodes
Imports DevExpress.Drawing
Imports System.Diagnostics

' Create an Aztec Code.
Dim barCode As New BarCode()
barCode.Symbology = Symbology.AztecCode
barCode.CodeText = "0123-456789"
barCode.Options.AztecCode.ErrorLevel = AztecCodeErrorLevel.Level1
barCode.Options.AztecCode.Version = AztecCodeVersion.Version45x45
' Save the barcode as an image.
barCode.Save("BarCodeImage.png", DXImageFormat.Png)
' Open the image in the default viewer.
Process.Start(New ProcessStartInfo("BarCodeImage.png") With {.UseShellExecute = True})