QR-Code, also known as Quick Response Code, Denso Barcode, QRCode, JIS X 0510, ISO/IEC 18004, is a matrix (two-dimensional symbol) symbology initially designed by Denso Wave for the automotive industry. And now it is widely used in various industries for its fast readability and data capacity.
Compatibility: Barcode for .NET component SDK is compatible with ISO/IEC 18004 (Second Edition 2006-09-01) bar code symbology specification.
Encoding: QR-Code bar code can encode multiple types of data, including numeric and alphanumeric characters (A-Z, a-z, 0-9), Kanji characters (JIS X 0510), and byte data (default is ISO/IEC 8859-1, including characters from English, German, French, Italian, Spanish, Portuguese, Dutch, Afrikaans, etc.)
GS1 QR Codes are used in supply chain and retail applications. They incorporate Application Identifiers (AIs) to define the meaning of the encoded data.
Set the FNC1Mode property to QRCodeFNC1Mode.FirstPosition. This inserts a special Function 1 Character at the first position, indicating the QR Code is GS1 compliant.
Enter the GS1 data message in the Data property, enclosing each AI code in parentheses.
QR Code versions (1 to 40) define the size of the symbol. The library automatically selects the appropriate version based on data and error correction settings. You can also specify a version manually.
The quiet zone is the blank area surrounding the QR Code. It is essential for reliable scanning.
You can customize the margins using the LeftMargin, RightMargin, TopMargin, and BottomMargin properties.
The BarcodeLib library allows you to change the bar and space colors, as well as the output image format. This is particularly useful when integrating QR Codes into branded WinForms or WPF user interfaces.
You can customize QR Code module and space colors through property ModuleColor and BackgroundColor.
QR Code can encode several types of data in VB.NET code, each suited for different use cases:
Numbers (digits 0 - 9): Ideal for numeric identifiers like product codes.
ASCII characters: Includes the standard 128 ASCII characters and extended ASCII.
Unicode text: Supports international characters, such as accented letters or non Latin scripts.
Binary data: Allows encoding of raw byte data.
Kanji characters: Japanese characters that can be compacted into 13 bits for efficiency.
Data modes
The library selects the most efficient encoding mode automatically. You may also specify a mode manually.
Available QRCodeEncoding options:
Auto: The library determines the appropriate mode(s) based on the input data. (Recommended for most scenarios)
Numeric: For digits only (0 - 9).
AlphaNumeric: For uppercase letters, digits, and nine special characters: space, $, %, *, +, -, ., /, :.
Byte: For binary or ISO/IEC 8859 1 data.
Kanji: For Kanji character encoding.
Sample VB.NET code to specify the QR Code data mode.
barcode.Encoding=QRCodeEncoding.Auto
Maximum data capacity
The maximum number of characters a QR Code can hold depends on the version (up to Version 40) and error correction level.
With the lowest error correction (L):
Numeric data: 7,089 characters
Alphanumeric data: 4,296 characters
Byte data: 2,953 characters
Kanji data: 1,817 characters
Error correction level (ECL)
QR Code includes Reed Solomon error correction, which allows data recovery even if part of the symbol is damaged.
Four levels are defined (L, M, Q, H), with increasing correction capacity:
L: 7% recovery (default)
M: 15% recovery
Q: 25% recovery
H: 30% recovery
Sample VB.NET source code:
qrcode.ECL=QRCodeErrorCorrectionLevel.M
How to Generate QR Code 2D Bar Code Using VB.NET Class
How to Install
Add barcode dll component to your VB.NET project reference.
Click "Project" and select "Add Reference...".
Click "Browse" to find Barcodelib.Barcode.ASP.NET.dll or BarcodeLib.Barcode.WinForms.dll in the unzipped file, and click "OK" button.
Add BarcodeLib barcoding dlls to Visual Studio Toolbox.
Right click in Toolbox and select "Choose Items...".
In the pop-up "Choose Toolbox items" window, click "Browse..." to select either BarcodeLib.Barcode.WinFroms.dll or Barcodelib.Barcode.ASP.NET.dll.
Click "OK" and now four items are listed in VS Toolbox, for example: QRCodeWinForm, DataMatrixWinForm, LinearWinForm, and PDF417WinForm.
How to Create QR-Code Bar Codes in VB.NET ASP.NET Web Applications?
BarcodeLib.com QR Code VB.NET generator supports streaming QR Code barcode images in ASP.NET web in two ways.
VB.NET QR Code barcode generation through BarcodeLib Buildin ASP.NET Barcode Application.
Unzip the downloaded evaluation package, and copy barcode folder and its contents to your IIS folder, eg. C:\inetpub.
Create a new virtual directory in your IIS, name it "barcode", and connect it to the above "barcode" folder in inetpub.
Restart IIS for a QR Code streaming test. Simply navigate to: http://YourDomain:Port/barcode/qrcode.aspx?Data=12345678&LeftMargin=6&RightMargin=6&TopMargin=6&BottomMargin=6 Above is the generated QR Code barcode image. If you need to adjust other QR Code dimensions, please view more web stream URL parameters for QR Code here: .NET QR-Code Generator Property Settings.
You can also 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=12345678&LeftMargin=12&RightMargin=12&TopMargin=12&BottomMargin=12 /> This method will not generate any barcode images in your IIS server side.
VB.NET QR Code barcodes encoding through ASP.NET Web Form Controller.
Intall ASP.NET barcode controller to your barcoding project by adding reference.
Add barcode library to your Visual Studio toolbox.
Open barcode in your unzipped trial package, and copy files "qrcode.aspx", "qrcode.aspx.cs" to the aspx page where you will be generating QR Code images.
Now you can drag QRCodeASPNET to your ASP.NET web site, and change QR code settings through properties window on the right.
Run the project and a QR Code barcode is generated on your aspx pages.
Or you may directly generate QR Code barcodes using above Free demo VB.NET code for your ASP.NET applications.
How to Draw QR-Code Images in VB.NET Windows Applications?
This guide has walked through the essential aspects of generating QR Codes using the BarcodeLib SDK in VB.NET.
The library supports a wide range of data types, flexible dimension controls, and customizable appearance options, making it suitable for integration into Windows Forms (WinForms) and Windows Presentation Foundation (WPF) applications.
By following the steps and examples provided, you can incorporate QR Code generation into your .NET projects with confidence.