Change QR Code Color using C#

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#

  1. Set the IDE to use Aspose.BarCode for creating colorful QR codes
  2. Create a BarCodeGenerator object with EncodeTypes QR
  3. Set the text to be encoded in the QR code
  4. Set the background color
  5. 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#.

 English