This short tutorial guides how to change QR code color using C#. It shares the necessary resources required for establishing the environment, a list of steps defining the program flow, and a sample code demonstrating how to develop a colored QR code generator using C#. It contains information to customize the output image by setting various parameters of different objects the API exposes.
Steps to Change Color of QR Code using C#
- Set the IDE to use Aspose.BarCode for creating colorful QR codes
- Create a BarCodeGenerator object with EncodeTypes QR
- Set the text to be encoded in the QR code
- Set the background color
- Save the output QR code image in the specified format
These steps summarize how to generate colored QR code using C#. Create a BarcodeGenerator object by setting the Encode type as QR, text for the QR code, and BackColor in the parameters list to define the background color of the QR. Finally, save the resultant QR code image as a PNG on the disk.
Code for Colored QR Code Generator using C#
This sample code can be used to color QR code using C#. You can set encoding type to Codabar, Code11, Code39, Code128, EAN13, EAN14, ISSN, OPC, etc. to list a few. In the parameters, we can set AutoSizeMode, Border, above/below caption, image height/width, and resolution.
This tutorial has guided us to generate QR code on color background using C#. If you want to read a barcode, refer to the article on Generate EAN 13 barcode in C#.