ComponentOne QRCode for ASP.NET Web Forms
QRCode Features / Color
In This Topic
    Color
    In This Topic

    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.

    A QRCode with a dark background and light symbols is not recommended, as it may not be scanned properly.

    In the Designer           

    1. Right click the QRCode and select Properties. The Properties window opens.
    2. Set the BackColor and ForeColor properties in the Properties window.

    In Source View

    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" />
    

    In Code

    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")
    

    What You've Accomplished

    When you run your application, notice that the QRCode appears colored.