VOOZH about

URL: https://ironsoftware.com/csharp/barcode/how-to/customize-qr-code-style/

⇱ C# QR Code Customization: Add Logos & Colors | IronBarcode


Skip to footer content

On This Page

  1. IronBarcode
  2. How-Tos
  3. .NET Create custom QR Code

How to Customize and Add Logos to QR Codes in C#

Customize QR codes in C# by adding logos, changing colors, and including annotations using IronBarcode's CreateQrCodeWithLogo method and styling features to create branded, professional QR codes for marketing and business applications.

QR codes have gained popularity over traditional barcodes due to their higher data capacity and ease of scanning. They are especially valued in marketing for their customizability, including options for adding logos, changing colors, and incorporating other branding elements. Modern businesses leverage custom QR codes for various marketing campaigns and customer engagement strategies.

To meet this demand, IronBarcode offers a suite of features for customizing QR codes. Users can create QR codes with logos, change color schemes, and add annotations. These capabilities are powered by IronDrawing, a free and open-source library. The library supports multiple barcode formats including standard QR codes, Micro QR, and the latest rMQR formats.

Quickstart: Build a Branded QR Code in One Line

Get started instantly by creating a QR code with your logo, custom color, and annotationβ€”all with minimal setup and just one line of IronBarcode code. Perfect for developers who want professional branding fast.

  1. Install IronBarcode with NuGet Package Manager

    PM > Install-Package BarCode
  2. Copy and run this code snippet.

    IronBarCode.QRCodeWriter.CreateQrCodeWithLogo("https://example.com", new IronBarCode.QRCodeLogo("logo.png"), 300).ChangeBarCodeColor(IronSoftware.Drawing.Color.DeepSkyBlue).AddAnnotationTextAboveBarcode("Scan Me", new IronSoftware.Drawing.Font("Verdana",12), IronSoftware.Drawing.Color.White, 5).SaveAsPng("customQR.png");
  3. Deploy to test on your live environment

    Start using IronBarcode in your project today with a free trial

Minimal Workflow (5 steps)

  1. Download the C# library for customizing QR codes
  2. Use CreateQrCodeWithLogo to create a QR code with a logo
  3. Apply custom colors with ChangeBarCodeColor
  4. Add annotations using AddAnnotationTextAboveBarcode
  5. Display QR code value with AddBarcodeValueTextBelowBarcode


How Do I Create QR Codes With a Logo?

A QRCodeLogo object is required to embed the logo image while generating the QR code. The CreateQrCodeWithLogo method generates a QR code with a logo. This method is part of IronBarcode's comprehensive QR code generation features, which provide extensive customization options for developers.

:path=/static-assets/barcode/content-code-examples/how-to/customize-qr-code-style-logo.cs
using IronBarCode;
using IronSoftware.Drawing;

// Create QR code logo from file path
QRCodeLogo logo = new QRCodeLogo("ironbarcode_top.webp", 0, 0, 20f);

GeneratedBarcode QrCodeWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", logo, 250);

QrCodeWithLogo.SaveAsPng("QrCodeWLogo2.png");
Imports IronBarCode
Imports IronSoftware.Drawing

' Create QR code logo from file path
Dim logo As New QRCodeLogo("ironbarcode_top.webp", 0, 0, 20.0F)

Dim QrCodeWithLogo As GeneratedBarcode = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", logo, 250)

QrCodeWithLogo.SaveAsPng("QrCodeWLogo2.png")
$vbLabelText   $csharpLabel

Let's examine the output QR code generated by the code above. The QR code features a logo in the center with rounded edges. The logo integration maintains the QR code's scannability while adding brand identity.

What Parameters Control Logo Appearance?

To customize the logo, fill in specific fields when creating a new QRCodeLogo object. Here are the required fields:

  • Importing Image: Import images from AnyBitmap, Stream, Byte Array, relative filepath, or URI. For optimal results, use high-resolution images in common formats like PNG, JPEG, or WebP.
  • Image Dimensions: Specify the desired width and height in pixels. If the image is too large for the QR code to remain readable, an exception will be thrown. Use 0 to automatically determine the largest viable size.
  • Image Corners: Set the radius for rounded corners. Use 0 for square corners. Rounded corners create a more professional appearance and better visual integration.

How Do I Export the Generated QR Code?

To export the generated QR code, invoke a save method. Export options include image files, Streams, HTML, and PDF. Learn more about exporting barcodes as different formats in our comprehensive guide. For web applications, you can also export barcodes as HTML for direct embedding in web pages.

How Can I Change the Color of My QR Code?

Besides adding logos, IronBarcode enables users to customize QR codes by changing their color. With IronDrawing, users can define colors using RGB values or Hex color codes and apply them to QR codes. This feature is particularly useful for maintaining brand consistency across marketing materials. Let's examine a code snippet demonstrating this feature and the resulting QR code.

:path=/static-assets/barcode/content-code-examples/how-to/customize-qr-code-style-logo-color.cs
using IronBarCode;
using IronSoftware.Drawing;

// Create QR code logo from file path
QRCodeLogo logo = new QRCodeLogo("ironbarcode_top.webp", 0, 0, 20f);

IronSoftware.Drawing.Color ColorFromRgb = new IronSoftware.Drawing.Color(51, 51, 153);

GeneratedBarcode QrCodeWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", logo, 250);
GeneratedBarcode QrCodeWithLogoAndColor = QrCodeWithLogo.ChangeBarCodeColor(ColorFromRgb);
QrCodeWithLogoAndColor.SaveAsPng("ColorQrCodeWithLogo.png");
Imports IronBarCode
Imports IronSoftware.Drawing

' Create QR code logo from file path
Dim logo As New QRCodeLogo("ironbarcode_top.webp", 0, 0, 20.0F)

Dim ColorFromRgb As New IronSoftware.Drawing.Color(51, 51, 153)

Dim QrCodeWithLogo As GeneratedBarcode = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", logo, 250)
Dim QrCodeWithLogoAndColor As GeneratedBarcode = QrCodeWithLogo.ChangeBarCodeColor(ColorFromRgb)
QrCodeWithLogoAndColor.SaveAsPng("ColorQrCodeWithLogo.png")
$vbLabelText   $csharpLabel

What Color Formats Are Supported?

The code above extends the previous example of creating QR codes with logos. It demonstrates changing QR code color using the ChangeBarCodeColor method, which takes an IronSoftware.Drawing.Color object as input. Create this object using RGB values, Hex codes, or predefined enums. Visit our "Create Color" code example to learn more. The color customization feature works seamlessly with all supported barcode formats.

When Should I Use Custom Colors?

Custom colors are particularly useful for:

  • Brand consistency: Matching QR codes to your company's visual identity
  • Campaign themes: Creating themed QR codes for special campaigns and events
  • Visual hierarchy: Using color to highlight important QR codes in print materials
  • Accessibility: Ensuring sufficient contrast for better scanning in various conditions

When selecting colors, maintain adequate contrast between the QR code pattern and background to ensure reliable scanning. Dark colors on light backgrounds typically work best.

How Do I Add Annotations to QR Codes?

Another important aspect of customizing QR codes is adding annotations within the QR code image. These annotations can be the barcode value itself or custom text for promotional purposes. Annotations help users understand what the QR code contains before scanning, improving user experience and engagement rates.

Let's examine the implementation of these methods and the resulting QR code image.

:path=/static-assets/barcode/content-code-examples/how-to/customize-qr-code-style-logo-color-annotation.cs
using IronBarCode;
using IronSoftware.Drawing;

// Create QR code logo from file path
QRCodeLogo logo = new QRCodeLogo("ironbarcode_top.webp", 0, 0, 20f);

// Define color from RGB
Color colorForBarcode = new Color(51, 51, 153);

GeneratedBarcode qrCodeWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", logo, 250);
GeneratedBarcode qrCodeWithLogoAndColor = qrCodeWithLogo.ChangeBarCodeColor(colorForBarcode);
GeneratedBarcode qrCodeWithAnnotation = qrCodeWithLogoAndColor.AddAnnotationTextAboveBarcode("IronBarcodeRocks!", 2).AddBarcodeValueTextBelowBarcode(2);
qrCodeWithAnnotation.SaveAsPng("QRCodeWithAnnotation.png");
Imports IronBarCode
Imports IronSoftware.Drawing

' Create QR code logo from file path
Dim logo As New QRCodeLogo("ironbarcode_top.webp", 0, 0, 20.0F)

' Define color from RGB
Dim colorForBarcode As New Color(51, 51, 153)

Dim qrCodeWithLogo As GeneratedBarcode = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", logo, 250)
Dim qrCodeWithLogoAndColor As GeneratedBarcode = qrCodeWithLogo.ChangeBarCodeColor(colorForBarcode)
Dim qrCodeWithAnnotation As GeneratedBarcode = qrCodeWithLogoAndColor.AddAnnotationTextAboveBarcode("IronBarcodeRocks!", 2).AddBarcodeValueTextBelowBarcode(2)
qrCodeWithAnnotation.SaveAsPng("QRCodeWithAnnotation.png")
$vbLabelText   $csharpLabel

What Annotation Methods Are Available?

IronBarcode provides methods for setting the annotation's position (above or below the QR code) as well as its font family and color. Available methods include:

  • AddAnnotationTextAboveBarcode: Adds annotation text above the QR code
  • AddAnnotationTextBelowBarcode: Adds annotation text below the QR code
  • AddBarcodeValueTextAboveBarcode: Adds barcode value text above the QR code
  • AddBarcodeValueTextBelowBarcode: Adds barcode value text below the QR code

These methods can be chained together for multiple annotations. For more advanced styling options, refer to our comprehensive barcode styling guide.

How Can I Customize Annotation Appearance?

All four methods accept a custom font as an IronSoftware.Drawing.Font object, color as an IronSoftware.Drawing.Color object, and an integer to specify the top and bottom spacing in pixels. These parameters are optional; if not specified, default font, color, and spacing will be used. The Font object supports various font families, styles (Bold, Italic, Regular), and sizes to match your branding requirements.

Why Use Annotations on QR Codes?

Annotations enhance QR codes by:

  • Providing context: Labels like "Scan for Menu" or "Visit Our Website" clarify purpose
  • Improving engagement: Clear calls-to-action increase scan rates
  • Building trust: Displaying the URL or company name helps users feel secure
  • Enhancing accessibility: Text annotations help users understand content without scanning

IronBarcode is an ideal tool for creating and customizing QR codes. Beyond the direct customization methods, IronBarcode uses IronDrawing as a helper library for image processing, providing more stability than depending on external libraries. For additional examples and advanced techniques, explore our C# QR Code Generator tutorial and API Reference for complete documentation of all available methods and properties.

Frequently Asked Questions

How do I add a logo to a QR code in C#?

You can add a logo to a QR code using IronBarcode's CreateQrCodeWithLogo method. Simply create a QRCodeLogo object with your image file path and pass it to the method along with your QR code data. The logo will be embedded in the center of the QR code while maintaining scannability.

Can I change the colors of my QR code?

Yes, IronBarcode provides the ChangeBarCodeColor method that allows you to customize QR code colors. You can apply any color from the IronSoftware.Drawing.Color palette to match your brand identity while ensuring the QR code remains scannable.

How do I add text annotations to a QR code?

IronBarcode offers methods like AddAnnotationTextAboveBarcode and AddBarcodeValueTextBelowBarcode to add text annotations. You can customize the font, size, color, and positioning of the text to create informative labels or calls-to-action on your QR codes.

What barcode formats are supported for customization?

IronBarcode supports customization for multiple barcode formats including standard QR codes, Micro QR codes, and the latest rMQR formats. Each format can be customized with logos, colors, and annotations to meet your specific requirements.

Can I create a branded QR code with just one line of code?

Yes, IronBarcode allows you to create a fully branded QR code in one line by chaining methods. You can combine CreateQrCodeWithLogo, ChangeBarCodeColor, and AddAnnotationTextAboveBarcode methods to generate a custom QR code with logo, colors, and text all at once.

What image formats can I use for QR code logos?

IronBarcode's QRCodeLogo feature supports common image formats like PNG, JPG, and other standard formats. The library automatically processes and embeds your logo image while maintaining optimal QR code readability.

How does logo integration affect QR code scannability?

IronBarcode automatically positions logos in the center of QR codes with appropriate sizing and padding to maintain scannability. The library ensures that the logo doesn't interfere with the QR code's error correction capabilities, keeping it readable by standard QR code scanners.

How can IronBarcode help in improving efficiency in business processes?

IronBarcode enhances business process efficiency by enabling quick and accurate barcode generation and reading, reducing manual data entry errors, and improving inventory and asset tracking.

What programming skills are needed to implement IronBarcode in a project?

Basic knowledge of C# programming is sufficient to implement IronBarcode in a project, as it provides straightforward methods and comprehensive documentation to guide developers.

Is IronBarcode suitable for both small projects and large enterprise applications?

IronBarcode is designed to be scalable and versatile, making it suitable for small projects as well as large enterprise applications that require robust barcode solutions.

Software Engineer
Like all great engineers, Hairil is an avid learner. He’s refining his knowledge of C#, Python, and Java, using that knowledge to add value to team members across Iron Software. Hairil joined the Iron Software team from Universiti Teknologi MARA in Malaysia, where he graduated with a Bachelor's degree ...
Read More
Ready to Get Started?
Nuget Downloads 2,287,186 | Version: 2026.6 just released

Still Scrolling?

Want proof fast? PM > Install-Package BarCode
run a sample watch your string become a barcode.

Get your FREE

30-day Trial Key instantly.

15-day Trial Key instantly.

The trial form was submitted
successfully.

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com

πŸ‘ bullet_checked
No credit card or account creation required
πŸ‘ bullet_test
Test in production
without watermarks
πŸ‘ bullet_calendar
30 days fully
functional product
πŸ‘ bullet_support
24/5 technical
support during trial
Install with NuGet
Version: 2026.6
Install-Package BarCode
nuget.org/packages/BarCode/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronBarCode"
  3. Select the package and install
Download DLL
Version: 2026.6
Download Now
Manually install into your project
  1. Download and unzip IronBarCode to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronBarCode.dll"
Licenses from $749

Have a question? Get in touch with our development team.

Now you've installed with Nuget
Your browser is now downloading IronBarcode

Next step: Start free 30-day Trial

No credit card required

  • Test in a live environment
  • Fully-functional product
  • 24/5 technical support

Thank You

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com
Get your free 30-day Trial Key instantly.
Thank you.
If you'd like to speak to our licensing team:
πŸ‘ badge_greencheck_in_yellowcircle
The trial form was submitted
successfully.

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com

Have a question? Get in touch with our development team.
No credit card or account creation required
Now you've installed with Nuget
Your browser is now downloading IronBarcode

Next step: Start free 30-day Trial

No credit card required

  • Test in a live environment
  • Fully-functional product
  • 24/5 technical support
Thank you.
View your license options:
Thank you.
If you'd like to speak to our licensing team:
Have a question? Get in touch with our development team.
Have a question? Get in touch with our development team.
Talk to Sales Team

Book a No-obligation Consult

How we can help:
  • Consult on your workflow & pain points
  • See how other companies solve their .NET document needs
  • All your questions answered to make sure you have all the information you need. (No commitment whatsoever.)
  • Get a tailored quote for your project's needs
Get Your No-Obligation Consult

Complete the form below or email sales@ironsoftware.com

Your details will always be kept confidential.

Trusted by Millions of Engineers Worldwide
Book Free Live Demo

Book a 30-minute, personal demo.

No contract, no card details, no commitments.

Here's what to expect:
  • A live demo of our product and its key features
  • Get project specific feature recommendations
  • All your questions are answered to make sure you have all the information you need.
    (No commitment whatsoever.)
CHOOSE TIME
YOUR INFO
Book your free Live Demo

Trusted by Millions of Engineers Worldwide

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me