.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:
- Add KeepDynamic.BarCode.Windows.dll to your C#, VB.NET project reference
- Add KeepDynamic.BarCode.Windows.dll to windows project toolbox
- 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:
- Add KeepDynamic.BarCode.AspNet.dll to your C#, VB.NET project reference
- Add KeepDynamic.BarCode.AspNet.dll to windows project toolbox
- Copy "qrcode.aspx", "qrcode.aspx.cs" from folder barcode to your ASP.NET project
- 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");
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")
.NET QR-Code Barcodes Properties
| Class Properties |
HTTP Parameters |
Default |
Comments |
| CodeText |
code-text |
"" |
Barcode value to encode |
| GraphicsUnit |
graphics-unit |
GraphicsUnit.Pixel |
Unit of meature for all size related settings Default is GraphicsUnit.Pixel |
| X |
x |
1 |
Width of barcode module (narrow bar) Default is 1 pixel |
| LeftMargin |
left-margin |
0 |
Barcode image left margin |
| RightMargin |
right-margin |
0 |
Barcode image right margin |
| TopMargin |
top-margin |
0 |
Barcode image top margin |
| BottomMargin |
bottom-margin |
0 |
Barcode image bottom margin |
| Resolution |
resolution |
72 |
Barcode image resolution in dpi |
| Rotate |
rotate |
0 |
Barcode rotate angle, valid values: 0, 90, 180, 270 |
| Format |
format |
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 |
QR-Code Error Correction Level |
| ECI |
eci |
3 |
|
| FNC1 |
fnc1 |
0 (none) |
|
| ApplicationIndicator |
application-indicator |
0 |
|
| StructuredAppend |
structured-append |
false |
If true, then Structured Append is enabled. |
| 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 |
|
| Version |
version |
1 |
Set the position of current symbol in the secuence (Start with 0). |
.NET QR-Code Barcodes Generator Supported Barcode Types
- 2D Barcodes:Data Matrix, PDF-417 and QR-Code.
- UPC / EAN Barcodes: EAN-8, EAN-13, ISBN, ISSN, UPC-A and UPC-E.
- Alphanumeric Barcodes:Code-39, Code-93, Code-128, GS1-128/UCC/EAN-128.
- Numeric Barcodes: Codabar, Code-11, RM4SCC and MSI Plessey.
- Code 2 of 5 based Barcodes: Code 2 of 5, Interleaved 2 of 5 and ITF-14.
- Postal Barcodes:Identcode, Leitcode, POSTNET, PLANET and USPS Intelligent Mail Barcode (OneCode).