Home  >  .NET Barcode Generator Suite  >  .NET Barcode Generation Guide  >  .NET Barcode QR Code Generator for .NET, C#, ASP.NET, VB.NET
.NET Barcode QR Code Generator
.NET QR-Code Introduction
QR-Code is also known as Denso Barcode, QRCode, Quick Response Code, JIS X 0510, ISO/IEC18004.
QR Code is a kind of 2-D (two-dimensional) symbology developed by Denso Wave (a division of Denso Corporation at the time) and released in 1994 with the primary aim of being a symbol that is easily interpreted by scanner equipment.
QR Code is capable of handling all types of data, such as numeric and alphabetic characters, Kanji, Kana, Hiragana, symbols, binary, and control codes.
The symbol versions of QR Code range from Version 1 to Version 40. Each version has a different module configuration or number of modules (the module refers to the black and white dots that make up QR Code). "Module configuration" refers to the number of modules contained in a symbol, commencing with Version 1 (21 x 21 modules) up to Version 40 (177 x 177 modules). Each higher version number comprises 4 additional modules per side. Each QR Code symbol version has the maximum data capacity according to the amount of data, character type and error correction level. In other words, as the amount of data increases, more modules are required to comprise QR Code, resulting in larger QR Code symbols.
QR Code has error correction capability to restore data if the code is dirty or damaged. Four error correction levels are available for users to choose according to the operating environment.Raising this level improves error correction capability but also increases the amount of data QR Code size. To select error correction level, various factors such as the operating environment and QR Code size need to be considered. Level Q or H may be selected for factory environment where QR Code gets dirty, whereas Level L may be selected for clean environment with the large amount of data. Typically, Level M (15%) is most frequently selected. The QR Code error correction feature is implemented by adding a Reed-Solomon Code to the original data.
How to Create QR-Code using .NET Barcode Generator Windows Form Control
To create QR-Code barcodes in Windows Forms applications, do the following procedures:
  1. Add KeepDynamic.BarCode.Windows.dll to your C#, VB.NET project reference
  2. Add KeepDynamic.BarCode.Windows.dll to windows project toolbox
  3. Drag the QRCodeControl item to your windows forms
How to Create QR-Code using ASP.NET Web Form Barcode Generator Control
To create QR-Code barcodes in ASP.NET Web Forms applications, do the following procedures:
  1. Add KeepDynamic.BarCode.AspNet.dll to your C#, VB.NET project reference
  2. Add KeepDynamic.BarCode.AspNet.dll to windows project toolbox
  3. Copy "qrcode.aspx", "qrcode.aspx.cs" from folder barcode to your ASP.NET project
  4. Drag the QRCodeControl item to your ASP.NET Web form pages, in your ASP.NET design view
How to Generate QR-Code Barcodes using C#.NET Class?
The following C# .NET code illustrates how to generate a QR-Code barcode in C# class:
// Create QR-Code barcode object in C#
QRCode barcode = new QRCode();

// Set QR-Code barcode value in C#
barcode.CodeText = "QRCode in C#";

// Set QR Code module size
barcode.X = 4;

// Set QR Code quiet zone
barcode.BottomMargin = 16;
barcode.LeftMargin = 16;
barcode.RightMargin = 16;
barcode.TopMargin = 16;

//Set QR Code error correction level
barcode.ECL = QRCodeECL.L;


// Set QR-Code drawing image format to PNG in C#
barcode.Format = System.Drawing.Imaging.ImageFormat.Png;

// Generate QR-Code barcode & encode to the png image in C#
barcode.drawBarcode("C://barcode-qrcode-csharp.png");
More C# code to generate & create QR Code in .NET application
How to Generate QR-Code Barcodes in VB.NET Class?
The following VB.NET code illustrates how to generate QR-Code barcodes in VB.NET class:
' Create QR-Code barcode object in VB.NET
Dim barcode As New QRCode()

' Set QR-Code barcode value in VB.NET
barcode.CodeText = "QRCode in VB.NET"

' Set QR Code module size
barcode.X = 4

' Set QR Code quiet zone
barcode.BottomMargin = 16
barcode.LeftMargin = 16
barcode.RightMargin = 16
barcode.TopMargin = 16

'Set QR Code error correction level
barcode.ECL = QRCodeECL.L


' Set QR-Code drawing image format to PNG in VB.NET
barcode.Format = System.Drawing.Imaging.ImageFormat.Png

' Generate QR-Code barcode & encode to the png image in VB.NET
barcode.drawBarcode("C://barcode-qrcode-vbnet.png")
More VB.NET code to generate & create QR Code in .NET application
.NET QR-Code Barcodes Properties

Barcode properties HTTP Parameters Default Comments
CodeText code-text "" QR Code has a very large amounts of data capacity. The encodable character set includes

  • numeric data, digits from 0 to 9
  • alphnumeric data, digits 0 - 9, all upper case letters, and special characters (space, $ % * + - . / :)
  • byte data
  • Kanji characters
GraphicsUnit graphics-unit GraphicsUnit.Pixel The unit of measurement for all size related settings.
  • 0: pixel
  • 1: cm
  • 2: inch
  • The default value is pixel.
X x 1 The narrow bar module width of QR Code and the default value of X is 1 pixels.

This value of X dimension may need to be increased to enhance the readability of the barcode if the barcode scanners could not read the barcode with small X dimension.
LeftMargin left-margin 0 The property to set the distance between the symbol and the left margin of a barcode image.
RightMargin right-margin 0 The property to set the distance between the symbol and the right margin of a barcode image.
TopMargin top-margin 0 The property to customize the space between the symbol and the top margin on a barcode image
BottomMargin bottom-margin 0 The property to change the space between the symbol and the bottom margin on a barcode image
Resolution resolution 72 This property set the resolution in DPI of a barcode image to be drawn, and the default value that is set to printer is 72 pixels. You can adjust the value to get a custom resolution barcode image.
Rotate rotate 0 The Rotate property allows you changing the angle of a barcode. The valid values are:
  • Rotate0: do not rotate the barcode
  • Rotate90: rotate the barcode 90 degrees clockwise
  • Rotate180: rotate the barcode 180 degrees clockwise
  • Rotate270: rotate the barcode 270 degrees clockwise
Format format ImageFormat.Png This is a method that is used for exporting barcode to different type of image formats. It allows developers generate barcode in formats like:
  • JPEG/JPG
  • BMP
  • GIF
  • PNG
The default method is ImageFormat.Png. Image format type. Using System.Drawing.Imaging.ImageFormat
ProcessTilde process-tilde false Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is false.

~NNN: is used to represent the ASCII character with the value of NNN. NNN is from 000 - 255.
DataMode data-mode QRCodeDataMode.Auto
  • QRCodeDataMode.Auto: It allows encoding all 256 possible 8-bit byte values. This includes all ASCII characters value from 0 to 127 inclusive and provides for international character set support
  • QRCodeDataMode.AlphaNumeric: It allows encoding alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : ).
  • QRCodeDataMode.Byte: It allows encoding byte data (default: ISO/IEC 8859-1).
  • QRCodeDataMode.Numeric: It allows encoding numeric data (digits 0 - 9).
  • QRCodeDataMode.Kanji: It allows encoding Kanji characters.
ECL ecl QRCodeECL.L The Error Correction Level of QR Code symbol. QR Code uses the Reed-Solomon error correction with four levels of error correction (referred to as L, M, Q, and H) allowing recovery of
  • Level L, 7%
  • Level M, 15%,
  • Level Q, 25%,
  • Level H, 30%
of the symbol codewords.
ECI eci 3 The Extended Channel Interpretations of QR Code. ECI is a protocol used to interpret the default character set to different output data stream.
FNC1 fnc1 0 (none) FNC1 mode is used to specify data formats. When the FNC1 is in the first position, it assigns the data formatted on the basis of GS1 General Specifications. When it is in the second position, it assigns the data formatted on the basis of a specific industry application.
ApplicationIndicator application-indicator 0 The Application Identifier. It is used to identify the data type in a symbol and is primarily used in GS1 symbologies.
StructuredAppend structured-append false If true, then Structured Append is enabled and allows the encoding of the data being splited from a message over a number of QR Code symbols.
SymbolCount symbol-count 1 Set the number of total symbols which make the sequence.
SymbolIndex symbol-index 1 Set the position of current symbol in the secuence (Start with 0).
Parity parity 0 The Parity Data
Version version 1 There are forty versions, from V1 to V40, of QR Code which is in accordance with forty sizes of the symbol.
  • Version 1: 21 modules x 21 modules
  • Version 2: 25 modules x 25 modules
  • Version 3: 29 modules x 29 modules
  • ...
  • ...
  • Version 40: 177 modules x 177 modules
The version of higher number in sequence has larger data capacity than that of lower number.

.NET QR-Code Barcodes Generator Supported Barcode Types