VintaSoft Barcode .NET SDK is a professional cross-platform SDK for Windows, Linux, macOS, Android, which allows you to recognize and generate Aztec Code barcodes in .NET, WPF, Web, MAUI.
VintaSoft Barcode .NET SDK allows you to embed the functionality of Aztec Code barcode recognition and generation using just a few lines of code.
What is Aztec Code barcode?
The Aztec Code barcode is the most compact two-dimensional matrix barcode. It takes up less space than other matrix barcodes due to the absence of a free zone and a compact search pattern. A distinctive feature of the Aztec Code barcode is the unique square search pattern "bullseye" located in the center of the barcode:
Features of the Aztec Code barcode
The Aztec Code barcode is defined by the ISO/IEC 24778 standard of 2008. The Aztec Code barcode can store mixed data of different types in three encoding modes:
- Alphanumeric (up to 3067 characters)
- Byte (up to 1914 bytes)
- Numeric (up to 3822 digits)
The Aztec Code barcode uses the Reed-Solomon error correction algorithm, which allows it to recognize damaged barcodes. When creating a barcode, the user can specify the percentage of the data area that will be used by the error correction codewords.
Support for the GS1 standard allows you to encode data in GS1 format (
BarcodeSymbologySubsets.GS1Aztec).
The Aztec Code barcode can encode the following special characters:
Aztec Rune barcode – when a simple label is necessary
There is a special version of the Aztec Code barcode – Aztec Rune, which can encode only one number in the range from 0 to 255 (one byte):
The Aztec Rune barcode has a compact size of 11x11 modules and can be used as a label in production, for example, to control the orientation of packaging or to control the completeness of goods. This label can also be used to create an oriented reference point on the image, for this
VintaSoft Barcode .NET SDK provides the exact coordinates of the center of the search pattern of the recognized barcode:
AztecInfo.BulleyeCenter.
This feature can also be used in OMR forms for fast automatic recognition of OMR forms. More information about automatic image alignment using the Aztec Rune barcode can be found in the article
Use 2D barcodes for aligning image in .NET/C#.
The structure of Aztec barcode matrix
The Aztec Code barcode matrix has two versions - full-size and compact. The compact version can have up to 4 data layers (the full-size has up to 32 layers) and is distinguished by a reduced search pattern and the absence of timing patterns:
- Search pattern
- Format information
- Timing patterns
- Orientation patterns
- Data and error correction layer
The Aztec Code barcode can be more than just a square thanks to the special "Structure Append" symbol
Aztec Code barcode supports a special "Structure Append" symbol, which allows data to be divided into several Aztec Code barcodes. The "Structure Append" symbol is encoded in the barcode and allows the number of barcode parts and their order to be uniquely determined.
Because the Aztec Code barcode has no free zone, it is possible to create rectangular Aztec Code barcodes to mark an elongated area:
VintaSoft Barcode .NET SDK contains an algorithm for recovering data from a set of Aztec Code barcode parts that were separated using the "Structure Append" symbol.
What Aztec barcodes can VintaSoft Barcode .NET SDK recognize?
VintaSoft Barcode .NET SDK recognizes all types of Aztec Code and Aztec Rune barcodes. Unique algorithms are used for recognition, allowing to quickly recognize barcodes that have various problems:
- damaged matrix
- low contrast
- low modulation
- uneven lighting
- compression on one side
- spatial distortions
- barcode printed on a distorted surface
- large number of barcodes in one image
Here is a C# code that demonstrates how to recognize Aztec barcodes in an image captured from a camera:
/// <summary>
/// Reads Aztec Code barcodes from a <see cref="System.Drawing.Bitmap"/>.
/// </summary>
/// <param name="bitmap">A bitmap with barcodes.</param>
public static void ReadAztecCodeBarcodesFromBitmap(System.Drawing.Bitmap bitmap)
{
// create barcode reader
using (Vintasoft.Barcode.BarcodeReader reader = new Vintasoft.Barcode.BarcodeReader())
{
// specify that reader must search for Aztec barcodes
reader.Settings.ScanBarcodeTypes = Vintasoft.Barcode.BarcodeType.Aztec;
// read barcodes from image
Vintasoft.Barcode.IBarcodeInfo[] infos = Vintasoft.Barcode.GdiExtensions.ReadBarcodes(reader, bitmap);
// if barcodes are not detected
if (infos.Length == 0)
{
System.Console.WriteLine("No barcodes found.");
}
// if barcodes are detected
else
{
// get information about extracted barcodes
System.Console.WriteLine(string.Format("{0} barcodes found:", infos.Length));
System.Console.WriteLine();
for (int i = 0; i < infos.Length; i++)
{
Vintasoft.Barcode.IBarcodeInfo info = infos[i];
System.Console.WriteLine(string.Format("[{0}:{1}]", i + 1, info.BarcodeType));
System.Console.WriteLine(string.Format("Value: {0}", info.Value));
System.Console.WriteLine(string.Format("Region: {0}", info.Region));
System.Console.WriteLine();
}
}
}
}
What Aztec barcodes can VintaSoft Barcode .NET SDK generate?
VintaSoft Barcode .NET SDK generates all types of Aztec Code and Aztec Rune barcodes.
Here is a C# code that demonstrates how to generate a raster image of Aztec Code barcode:
/// <summary>
/// Returns the Aztec Code barcode as <see cref="System.Drawing.Bitmap"/>.
/// </summary>
/// <param name="value">The barcode value.</param>
/// <returns>A <see cref="System.Drawing.Bitmap"/> object.</returns>
public static System.Drawing.Bitmap GetAztecCodeBarcodeAsBitmap(string value)
{
// create the barcode writer
using (Vintasoft.Barcode.BarcodeWriter barcodeWriter = new Vintasoft.Barcode.BarcodeWriter())
{
// set barcode writer settings
barcodeWriter.Settings.Barcode = Vintasoft.Barcode.BarcodeType.Aztec;
barcodeWriter.Settings.Value = value;
// get a barcode image as System.Drawing.Bitmap
return Vintasoft.Barcode.GdiExtensions.GetBarcodeAsBitmap(barcodeWriter);
}
}
Here is a C# code that demonstrates how to generate a vector (SVG) image of Aztec Code barcode:
/// <summary>
/// Returns the Aztec Code barcode in vector form as a SVG string.
/// </summary>
/// <param name="barcodeValue">Barcode value.</param>
public static void GetAztecCodeBarcodeAsSvgString(string barcodeValue)
{
// create the barcode writer
using (Vintasoft.Barcode.BarcodeWriter barcodeWriter = new Vintasoft.Barcode.BarcodeWriter())
{
// set barcode writer settings
barcodeWriter.Settings.Barcode = Vintasoft.Barcode.BarcodeType.Aztec;
barcodeWriter.Settings.Value = barcodeValue;
// generate Aztec Code barcode as a SVG string
return barcodeWriter.GetBarcodeAsSvgFile();
}
}