Conventionally, QRCodes are black and white. But, you can add color to the control, without distorting the scannability of the QRCode. This is the easiest way to customize the QRCode and add branding to it. Along with color, you may also add a logo or other images on the QRCode to customize it further. Please see Add a Logo for more information.
Set the BackColor and ForeColor properties within the <cc1:C1QRCode>
tag, to add color to the QRCode.
Source View |
Copy Code
|
---|---|
<cc1:C1QRCode ID="C1QRCode1" runat="server" BackColor="#FFFFCC" ForeColor="#6600CC" Text="QRCode Sample Text" /> |
Add the following code to the Page_Load event, to set the BackColor and ForeColor properties in code view.
C# |
Copy Code
|
---|---|
C1QRCode1.BackColor = System.Drawing.ColorTranslator.FromHtml("#FFFFCC"); C1QRCode1.ForeColor = System.Drawing.ColorTranslator.FromHtml("#6600CC"); |
VB |
Copy Code
|
---|---|
C1QRCode1.BackColor = System.Drawing.ColorTranslator.FromHtml("#FFFFCC") C1QRCode1.ForeColor = System.Drawing.ColorTranslator.FromHtml("#6600CC") |
When you run your application, notice that the QRCode appears colored.