Quick to scan QR Codes in VB.NET WinForms, WPF application
You can implement fast QR Code scanning in your VB.NET application with a single method call.
This method returns raw QR Code text messages directly.
This method returns raw QR Code text messages directly.
- Call the core scanning method
BarcodeScanner.Scan(). - Pass the QR Code image file path as the first parameter.
- Set the barcode type to
BarcodeType.QRCode. - The method returns a string array containing all decoded QR Code data.
' Scan QR Code from image and get raw text data Dim datas As String() = BarcodeScanner.Scan("qrcode-sample.png", BarcodeType.QRCode)
Scan multiple QR Codes from an image file in VB.net
OnBarcode VB.NET Barcode Reader library will automatically scan and recognize all QR Codes from a single image file in VB program.
Scan and read all QR Code informations from image in VB.NET
Here we will learn how to retrieve detailed QR Code metadata and extract advanced barcode properties using VB.NET.
You can obtain full barcode metadata by calling
This method returns an array of
You can obtain full barcode metadata by calling
BarcodeScanner.ScanInDetails().
This method returns an array of
BarcodeDetail (barcode metadata entity) objects containing complete scanning information.
- Call
BarcodeScanner.ScanInDetails()with the image path and barcode type. - The method returns detailed QR Code information including location and rotation.
' Scan QR Code and retrieve detailed barcode information Dim datasInDetail As BarcodeDetail() = BarcodeScanner.ScanInDetails( "qrcode-sample.png", BarcodeType.QRCode)
Process scanned QR Code data message in VB.NET Windows applications
QR Code supports a wide range of character sets and industry-standard data structures.
The VB.NET Barcode Reader library provides dedicated methods to parse and process these complex data types.
You can use built-in functions to handle multiple encoding formats efficiently.
The VB.NET Barcode Reader library provides dedicated methods to parse and process these complex data types.
You can use built-in functions to handle multiple encoding formats efficiently.
Supported Character Sets & Data Formats
The library supports processing the following formats from scanned QR Codes:- ASCII text
Includes both printable and non-printable characters. - Unicode text
Supports multi-language and universal character encoding. - Binary data
Supports raw byte data for files, streams, and custom payloads. - GS1 data elements
Supports industry-standard GS1-compliant barcode messages.
ASCII text characters
We will explain how to scan QR Code (2D matrix barcode) images and process ASCII text (American Standard Code for Information Interchange, including printable and non-printable characters) using VB.NET.
Full ASCII text table consists of 128 standard characters.The first 32 characters and the final character are non-printable control characters. One common example is the carriage return control character.
You can scan QR Codes and format non-printable ASCII characters into readable labels in VB.NET applications.
Full ASCII text table consists of 128 standard characters.The first 32 characters and the final character are non-printable control characters. One common example is the carriage return control character.
You can scan QR Codes and format non-printable ASCII characters into readable labels in VB.NET applications.
- Call
BarcodeScanner.Scan()to decode the QR Code image. - Check if valid barcode results are returned.
- Iterate through the scanned text messages.
- Replace non-printable carriage return characters (
\r) with a visible label[CR]. - Output both raw and formatted text values.
' Scan QR Code and get ASCII text results Dim result As String() = BarcodeScanner.Scan( "C:\Input\qrcode-ascii-sample.png", BarcodeType.QRCode) ' Check if any QR Code is detected If result.Length > 0 Then ' Process each scanned message For Each msg As String In result Debug.WriteLine("QR Code Raw Message: '" & msg & "'") ' Replace carriage return non-printable character with [CR] label Dim tmp As String = msg.Replace(vbCr, "[CR]") Debug.WriteLine("QR Code ASCII Text: '" & tmp & "'") Next Else Debug.WriteLine("No QR Code Scanned!") End If
Unicode text
QR Code supports Unicode text encoding. Most barcode generators and printers convert Unicode text to binary data. They then encode the binary data using QR Code binary mode.
To decode Unicode text correctly, you must use the matching encoding format. UTF8 encoding is the most common standard for Unicode QR Codes.
You can extract and decode Unicode text from QR Code using UTF8 encoding in VB.NET.
To decode Unicode text correctly, you must use the matching encoding format. UTF8 encoding is the most common standard for Unicode QR Codes.
You can extract and decode Unicode text from QR Code using UTF8 encoding in VB.NET.
- Call
BarcodeScanner.ScanInDetails()to read the QR Code image. - Use
GetDataBytes()to retrieve raw binary data from the barcode. - Decode the byte array using
System.Text.Encoding.UTF8. - Output the readable Unicode text result.
' Scan QR Code and retrieve detailed barcode information Dim datas As BarcodeDetail() = BarcodeScanner.ScanInDetails( "C:\Input\qrcode-unicode.png", BarcodeType.QRCode) ' Loop through all scanned barcode results For j As Integer = 0 To datas.Length - 1 ' Decode binary data to Unicode text using UTF8 encoding Dim textMsgDecoded As String = System.Text.Encoding.UTF8.GetString(datas(j).GetDataBytes()) ' Output decoded Unicode text Console.WriteLine("Unicode text: " & textMsgDecoded) Next
GS1 data message
The GS1 System uses QR Code as a common data carrier.
A GS1-encoded QR Code contains pairs of AI (Application Identifier, standard GS1 identification code) and corresponding data.
It may also include control characters like the Function 1 Symbol Character (FNC1).
The VB.NET Barcode Reader library automatically parses GS1 messages. You can directly read formatted GS1 data elements without handling low-level control characters.
Follow these steps to implement GS1 QR Code scanning and parsing in VB.NET:
The VB.NET Barcode Reader library automatically parses GS1 messages. You can directly read formatted GS1 data elements without handling low-level control characters.
Follow these steps to implement GS1 QR Code scanning and parsing in VB.NET:
- Call
BarcodeScanner.ScanInDetails()to load and scan the GS1 QR Code image. - Check the
IsGS1Compatibleproperty to verify GS1 compliance. - Use the
GetMessage()method to retrieve formatted GS1 text. - Split the result to extract individual AI and data pairs.
- Output structured GS1 elements for further processing.
' Scan GS1 QR Code and get detailed barcode information Dim result As BarcodeDetail() = BarcodeScanner.ScanInDetails( "C:\Input\qrcode-gs1-data.png", BarcodeType.QRCode) ' Iterate all scanned barcode results For Each b As BarcodeDetail In result ' Check if the barcode conforms to the GS1 standard If b.IsGS1Compatible Then ' Get formatted GS1 message (Example: (415)5412345678908(3911)710125) Dim msg As String = b.GetMessage() ' Output raw barcode data and formatted message Console.WriteLine("Raw Data: '{0}'", b.Data) Console.WriteLine("Text Message: {0}", msg) ' Split AI and data pairs using ( and ) delimiters Dim vals As String() = msg.Split({"("c, ")"c}, StringSplitOptions.RemoveEmptyEntries) ' Extract and display AI and corresponding data in pairs For i As Integer = 0 To vals.Length - 1 Step 2 Console.WriteLine("AI: {0}", vals(i)) Console.WriteLine("Data: {0}", vals(i + 1)) Next End If Next
How to scan QR Code with logo image in VB.NET?
OnBarcode .NET Barcode Reader library supports scanning QR Code with logo image inside. The barcode library will automatically read and detect colored QR Code with logo image inside.
Dim datas As String() = BarcodeScanner.Scan("qrcode-logo-image.png", BarcodeType.QRCode)
How to improve QR Code image reading performance in VB.NET Windows application?
The VB.NET Barcode Reader library offers multiple optimized methods to improve scanning efficiency.
These features reduce processing time and enhance responsiveness in desktop applications.
- Single QR Code Quick Scan
When enabled, the library stops scanning immediately after detecting the first valid QR Code. This eliminates unnecessary full-image processing. - Concurrent Multi-Type Barcode Scanning
Supports scanning QR Code and other barcode symbologies in a single operation. - Specified Region Scanning
Restricts scanning to defined rectangular areas of the image. This reduces the total pixel data that must be processed.
Scan a single QR Code
The VB.NET Barcode Reader library provides an optimized fast-scan feature.
When this feature is enabled, the scanning process stops immediately after detecting a valid QR Code.
This greatly reduces unnecessary processing and improves decoding speed.
This function is highly efficient for images that contain only one QR Code symbol.
When this feature is enabled, the scanning process stops immediately after detecting a valid QR Code.
This greatly reduces unnecessary processing and improves decoding speed.
This function is highly efficient for images that contain only one QR Code symbol.
- Use the dedicated method
BarcodeScanner.ScanSingleBarcode(). - Pass the image path and set the barcode type to
BarcodeType.QRCode. - The scanner stops automatically after detecting the first QR Code.
- Return the decoded barcode text as a string array.
' Scan and return only the first detected QR Code (fast mode) Dim barcodes As String() = BarcodeScanner.ScanSingleBarcode( "qrcode-single-barcode.png", BarcodeType.QRCode)
Scan multiple QR Codes with other barcode formats
The VB.NET Barcode Reader library supports scanning multiple barcode types in one operation. You can scan custom selected formats or all supported formats in a single pass.
You can also use
Scan specific barcode formats from one image for efficiency and accuracy.
BarcodeType.All to enable full library support.
Scan specific barcode formats from one image for efficiency and accuracy.
- Call the
BarcodeScanner.ScanInDetails()method to load the image and start decoding. - Pass a custom list of required barcode types as the scanning parameter.
- The library automatically identifies and decodes all matching barcodes in the image.
- Retrieve complete barcode metadata via the
BarcodeDetail(barcode information entity) array.
' Scan QR Code, GS1-128 (Code 128), EAN-13 barcodes simultaneously Dim datas As BarcodeDetail() = BarcodeScanner.ScanInDetails("qrcode-multiple-formats.png", New List(Of BarcodeType) From { BarcodeType.QRCode, BarcodeType.Code128, BarcodeType.EAN13})
Scan image regions to read QR Codes
You can define rectangular areas inside an image to limit the scanning scope.
This improves reading speed and reduces decoding errors.
The barcode library only processes the specified regions instead of the full image. This optimization works for QR Code and all other supported barcode symbologies.
VB.NET code to scan multiple barcodes within predefined regions using
VB.NET code to scan multiple barcodes within predefined regions using
ScanRegions().
- Create a list of
SRegionobjects to define scanning areas. - Add region coordinates (X, Y, Width, Height).
- Call
BarcodeScanner.ScanRegions()with the image path, barcode type, and region list. - Retrieve all detected barcodes as a string array.
' Define multiple scanning regions Dim regions As New List(Of SRegion)() regions.Add(New SRegion(0, 0, 50, 60)) regions.Add(New SRegion(100, 100, 50, 60)) ' Scan QR Code only from specified regions Dim barcodes As String() = BarcodeScanner.ScanRegions("qrcode-barcodes.png", BarcodeType.QRCode, regions)
Common Asked Questions
How to read QR Code on desktop?
You can use barcode scanner software installed on computer or barcode scanner device to read and extract QR Code from image.
OnBarcode VB.net QR Code Reader library supports building Windows application with QR Code scanning and reading functions with few lines of Visual Basic source codes.
How to read a QR code that's on your screen?
To read a QR Code on your screen, try the following steps
- Take and save the screenshot of the QR Code image on the computer
- Use QR Code scanner software to read the QR Code from the image
How do I scan a QR code with my phone?
You can download and install QR Code Scanner app on the iPhone or Android phones. OnBarcode VB.NET QR Code Scanner library supports building Xamarin application for iOS and Adroid with
QR Code reading functions.
How do you scan a QR code from an image?
Online QR Code decoder, QR Code Scanner software allow you to scan and extract a QR Code from an images.
Using OnBarcode QR Code Reader VB.NET SDK, you can quickly build online QR Code scanner based on Windows QR Code Scanner software using WinForms or WPF framework using VB.
Is there a scanner or reader for QR codes?
You can use iPhone and Android phone build-in QR Code Scanner app to read the QR Codes. If you are VB.NET developer, you can easily
build app for iOS and Android with QR Code Reader embed using VB.NET Barcode Reader library with Xamarin.