Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET Barcode > VB.NET Barcoding Tutorial > Change Barcode Image Color Using VB.NET
Download Barcode for .NET Suite Trial

How to Change Image Color of QR Code Using VB.NET

Free Sample VB.NET Codes to Generate & Set QR Code Background & Module Colors
  • Professional VB.NET barcoding control used for QR Code barcode generation
  • Written in managed C# and compatible with common .NET development platforms
  • Compile advanced VB.NET QR Code generation & color setting features into a DLL
  • Support QR Code color customization in WinForms projects & ASP.NET web site
  • Support generating colorful QR Code images in .NET Reporting & Console applications
  • Adjust QR Code image color using VB.NET class code or through Properties window
VB.NET QR Code Generator Control Overview
VB.NET QR Code Generator Control from BarcodeLib.com can generate industry-standard QR Code in a quick & accurate way. Besides, users can easily change & adjust the module color & background color of QR Code image using simple VB.NET class code.
How to Change QR Code Color in VB.NET Class
You can easily change QR Code color via two simple steps: Install VB.NET barcoding library dll and copy-&-paste sample VB.NET code below.

How to Install VB.NET Barcode Libarary DLLs

  • Download trial package and find "Barcodelib.Barcode.ASP.NET.dll" or "BarcodeLib.Barcode.WinForms.dll".
  • Add either of those two barcoding dlls into your VB.NET project by adding reference.
  • Integrate either of those two barcoding dlls into the Visual Studio Toolbox.

How to Set QR Code Color in VB.NET

The VB.NET code below is used to generate & adjust colorful QR Code images.
     ' Used to generate & create high-qualtiy QR Code image
     Dim qrcode As New BarcodeLib.Barcode.QRCode()
     qrcode.Encoding = BarcodeLib.Barcode.QRCodeEncoding.Auto
     qrcode.Data = "ABCD1234abcd"
     qrcode.ModuleSize = 3
     qrcode.LeftMargin = 12
     qrcode.RightMargin = 12
     qrcode.TopMargin = 12
     qrcode.BottomMargin = 12

     ' Used to set & adjust QR Code image colors
     qrcode.BackgroundColor = System.Drawing.Color.White
     qrcode.ModuleColor = System.Drawing.Color.Blue

     ' Used to draw & output QR Code to your system
     qrcode.drawBarcode("c:/vbqrcode.png")
How to Set QR Code Barcode Color in ASP.NET Web & IIS

Set QR Code Color in ASP.NET Web Application

  • Integrate "Barcodelib.Barcode.ASP.NET.dll" to your ASP.NET project by adding reference.
  • Add "Barcodelib.Barcode.ASP.NET.dll" to the VS Toolbox by choosing item.
  • Find folder "barcode" from downloaded package and copy files "qrcode.aspx", "qrcode.aspx.cs" inside it to your ASP.NET project folder.
  • Drag & drop "QRCodeASPNET" from the toolbox to your ASP.NET web page.
  • Adjust QR code colors through "Properties" window.

Adjust QR Code Barcode Color in IIS Application

  • Copy folder "barcode" from downloaded trial package and copy it to your IIS folder, eg. C:\inetpub.
  • Set a new virtual directory in your IIS, name it "barcode", and connect it to the above "barcode" folder.
  • Restart IIS. Later, open your web browser and navigate to:
    "http://YourDomain:port/barcode/qrcode.aspx?Data=12345678910&ModuleSize=2 &LeftMargin=8&RightMargin=8&TopMargin=8&BottomMargin=8&BackgroundColor=FFFFFF&ModuleColor=000079"
  • To insert this QR Code image in your aspx or html page, simply pass the url to IMG tag or src value.
    For example: <img src= http://YourDomain:Port/barcode/qrcode.aspx?Data=12345678910&ModuleSize=2 &LeftMargin=8&RightMargin=8&TopMargin=8&BottomMargin=8&BackgroundColor=FFFFFF&ModuleColor=000079>
    This method will not create any QR Code barcode images in your IIS server side.
How to Change QR Code Color in VB.NET Windows Forms
  • Add "BarcodeLib.Barcode.WinForms.dll" to your VB.NET Windows Forms by reference and to your Visual Studio Toolbox by adding items.
  • Drag the "QRCodeWinForm" control from the toolbox to your Windows Forms Project.
  • You can change background color & module color of generated QR Code by setting corresponding parameters in "Properties" window.
How to Generate 1D & 2D Barcodes in VB.NET
VB.NET 1D Barcode Types:
VB.NET 2D Barcode Types: