How to create styled QR Code with logo image in C#

Integration & Developer Guide for styled QR Code with logo image generation in ASP.NET Core MVC web application

Create custumized styled QR Code images in Visual C# .NET with complete sample C# source code



QR Code is a two-dimensional barcode symbology and it encodes some data. Now QR Codes connect the physical and digital worlds. A standard and ISO compatible QR Code cannot meet business and marketing requirements. We need more extra requirements for QR Code, including displaying logos, styled colors.

To meet these requirements, OnBarcode C# Barcode Generator provides list of functions for styled QR Code barcodes. C# developers can generate QR Codes with company logos, change the colors.

A sample styled QR Code with facebook logo printed




To create a QR Code with logo image inside is an easy task. First you need create a standard QR Code. Then you need provide a Bitmap object with logo image inside.

Here are the C# sample code and text to explain how to do it.



To add a logo image on the qr code barcode, you need create a QR Code object with options applied, such as, QR Code data message, data mode, versions, and QR Code dimension size settings.

And you also need apply the following required options for logo image rendering.
  • Logo: A Bitmap object which is containing the logo image. You can create and load the Bitmap object from an existing image filepath, Stream, byte array from database, or url.
  • LogoActualSize: The actual displayed dimension size (System.Drawing.SizeF) on the center of the QR Code.


            QRCode barcode = new QRCode();

            barcode.Data = "https://www.facebook.com";

            barcode.DataMode = QRCodeDataMode.Auto;

            //  Selecte format mode
            //  from V1 to V40
            barcode.Version = QRCodeVersion.V3;

            barcode.Logo = new System.Drawing.Bitmap("W://Projects//Test-Files//facebook_logo_2021.svg.png");
            barcode.LogoActualSize = new System.Drawing.SizeF(600, 600);


            // Barcode Size Related Settings
            barcode.UOM = UnitOfMeasure.INCH;
            barcode.AutoResize = true;
            barcode.BarcodeWidth = 3;
            barcode.BarcodeHeight = 3;
            barcode.Resolution = 900;
            barcode.AutoResizePaddingTransparent = true;

            // Image format setting
            barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;

            barcode.drawBarcode("W://Projects//Test-Output//OnBarcode.com//csharp-qrcode-logo.png");




Change the Colors of QR Codes



Using the above C# code, you can place a logo on the center of the generated QR Codes.

Here we will add more features to the styled QR Code. You can change the QR Code module and background colors to meet your business or marketing requirements.

The following C# code will change the QR Code module color to the same color as facebook logo.





  • ForeColor: Set the QR Code module color (forecolor) to Color.FromArgb(24, 119, 242)


            QRCode barcode = new QRCode();

            barcode.Data = "https://www.facebook.com";

            barcode.DataMode = QRCodeDataMode.Auto;

            //  Selecte format mode
            //  from V1 to V40
            barcode.Version = QRCodeVersion.V3;

            barcode.Logo = new System.Drawing.Bitmap("W://Projects//Test-Files//facebook_logo_2021.svg.png");
            barcode.LogoActualSize = new System.Drawing.SizeF(600, 600);

            barcode.ForeColor = Color.FromArgb(24, 119, 242);

            // Barcode Size Related Settings
            barcode.UOM = UnitOfMeasure.INCH;
            barcode.AutoResize = true;
            barcode.BarcodeWidth = 3;
            barcode.BarcodeHeight = 3;
            barcode.Resolution = 900;
            barcode.AutoResizePaddingTransparent = true;

            // Image format setting
            barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;

            barcode.drawBarcode("W://Projects//Test-Output//OnBarcode.com//csharp-qrcode-logo.png");








In a nutshell, OnBarcode C# barcode generator library will not only create fully ISO compatible QR Code, but also custumized styled QR Code for your business and marketing requirements.
















OnBarcode is a market-leading provider of barcode imaging generator, reader controls and components for ASP.NET, Windows Forms, WPF, as well Java, Android, iOS (iPhone, iPad) across all major enterprise development platforms. We provides comprehensive tutorials and how-tos for various linear, 2d barcode information, such as C# in ASP.NET, C# .NET, C# Barcode Encoding, C# Barcode Image, VB.NET in ASP.NET, VB.NET Winforms, VB.NET Barcode Encoding. OnBarcode barcode products are supported by RasterEdge ASP.NET Document Viewer, which supports ASP.NET PDF Viewer, ASP.NET MVC Document Viewer, ASP.NET PDF Editor, MVC PDF Viewer. And provide high quality C# Convert PDF to Tiff, C# Convert PDF to Word, C# Convert PDF to HTML, C# Convert PDF to Jpeg images, and their easy and simple documents, like C# PDF SDK, C# extract text from PDF, C# Compress PDF, Print PDF in C# and C# extract image from PDF.
Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.