QR Code Image Sample - pqScan.com
C#, VB.NET QR Code Creator Encoding QR Code Barcode Image in C# and VB.NET Online Demo Download Trial Purchase Now

How to Generate QR Code in C# and VB.NET

back to home  >  .NET Barcode Generator SDK  >  Generate Barcodes in C# & VB.NET  >  Generate QR Code in C# & VB.NET

C# and VB.NET QR Code Creator is one of the generation functions in pqScan Barcode Creator for .NET. It allows developers to use C Sharp and VB.NET language to generate QR Code in any .NET programming, such as making QR Code in ASP.NET application and encoding QR Code in .NET Winforms.

In this tutorial, we will introduce you how to generate QR Code using C#/VB.NET code in Console application.

Generate and print QR Code - C Sharp sample

With the following C# sample code, generating QR Code in C# looks so easy. Just a few lines of code in your .NET application, but render QR Code image perfectly and fast.

using System;
using System.Drawing;
using System.Drawing.Imaging;
using PQScan.BarcodeCreator;

namespace QRCodeGeneratorInCSharp
{
    classProgram
    {
        staticvoid Main(string[] args)
        {

            //Create an instance of PQScan.BarcodeCreator.Barcode object.
            Barcode qrcode = new Barcode();
            //Set barcode date to encode
            qrcode.Data = "pqScan123456789";
            //Set barcode type
            qrcode.BarType = BarCodeType.QRCode;
            //Set barcode image width
            qrcode.Width = 300;
            //Set barcode image height
            qrcode.Height = 300;
            //Set qrcode error correction level
            qrcode.QRCodeECL = ErrorCorrectionLevelMode.L;
            //Set barcode image fore groud color
            qrcode.BarcodeColor = Color.Black;
            //Set barcode image back ground color
            qrcode.BackgroundColor = Color.White;
            //Set barcode image format
            qrcode.PictureFormat = ImageFormat.Bmp;
            //Save barcode image to file
            qrcode.CreateBarcode("qrcode-csharp.bmp");      
        }
    }
}

Create and draw QR Code - Visual Basic sample

With the VB.NET sample code below, creating QR Code using VB.NET language becomes so easy to you. Just follow this guide, encoding a good quality QR Code is not far away.

Imports System.Drawing
Imports System.Drawing.Imaging
Imports PQScan.BarcodeCreator

Namespace QRCodeGeneratorInVB
    Class Program
        Private Shared Sub Main(args As String())

            'Create an instance of PQScan.BarcodeCreator.Barcode object.
            Dim qrcode As New Barcode()
            'Set barcode date to encode
            qrcode.Data = "pqScan123456789"
            'Set barcode type
            qrcode.BarType = BarCodeType.QRCode
            'Set barcode image width
            qrcode.Width = 300
            'Set barcode image height
            qrcode.Height = 300
            'Set qrcode error correction level
            qrcode.QRCodeECL = ErrorCorrectionLevelMode.L
            'Set barcode image fore groud color
            qrcode.BarcodeColor = Color.Black
            'Set barcode image back ground color
            qrcode.BackgroundColor = Color.White
            'Set barcode image format
            qrcode.PictureFormat = ImageFormat.Bmp
            'Save barcode image to file
            qrcode.CreateBarcode("qrcode-vb.bmp")
        End Sub
    End Class
End Namespace

generate qrcode in c#/vb.net

.NET Barcode Creator Data Matrix Creator in C#/VB PDF 417 Creator in C#/VB Aztec Creator in C#/VB EAN 13 Creator in C#/VB EAN 8 Creator in C#/VB UPC A Creator in C#/VB Code 128 Creator in C#/VB Code 39 Creator in C#/VB