Generate Maxicode Barcode in C#

A Maxicode code is a machine-readable barcode that contains dots arranged in a hexagonal shape. It can be created with different variations in different modes while containing a bullseye in the middle. In certain scenarios, you may need to create a Maxicode. Accordingly, this article covers how to create different types of Maxicodes programmatically in C#.

C# API Installation to Generate Maxicode Barcode - Free Download

You can easily install Aspose.BarCode for .NET library in your application. It enables you to generate or process different barcodes from within your .NET applications. Quickly download the reference DLL files from the New Releases page or install it from the NuGet Gallery with the following command:

PM> Install-Package Aspose.BarCode

Generate Maxicode Barcode in C#

You need to follow the steps below to generate a Maxicode barcode:

  1. Initialize an instance of the BarcodeGenerator class and specify the EncodeType.
  2. Set the number of pixels.
  3. Set MaxiCode encode mode and valid codetext.
  4. Create the Maxicode barcode as a PNG image.

The code sample below shows how to generate a Maxicode barcode programmatically in C#:

Generate Maxicode Barcode with Aspect Ratio in C#

You can set different values for the aspect ratio while creating a Maxicode barcode. Please follow the steps below to generate a Maxicode with the aspect ratio in C#.

  1. Create an instance of the BarcodeGenerator class and set the EncodeType parameter.
  2. Set the size as the number of pixels.
  3. Set the aspect ratio.
  4. Export the Maxicode Barcode as a PNG image.

The following code sample demonstrates how to generate a Maxicode barcode with aspect ratio in C#:

The following image depicts how the Maxicode appears when created using the code snippet above:

Generate Maxicode Aspect Ratio in C#

Get a Free License

You may evaluate the API without any evaluation limitations by requesting a free temporary license.

Conclusion

In this article, you have learned how to generate a Maxicode barcode programmatically in C#. It explains how to create different Maxicode barcodes with a variety of Encode modes, as well as how to create it with aspect ratios. Moreover, you may explore the documentation section to learn many other barcode manipulation features. In case you want to discuss any of your concerns or ambiguities, please feel free to reach out to us via forum.

See Also