Quick Response (QR) codes are two-dimensional barcodes that store information in a matrix of black squares on a white background. QR codes can store various types of data, including numeric, alphanumeric, binary, etc. In this blog post, we will learn how to scan a QR code in C#.
This article covers the following topics:
C# QR Code Scanner API
We will use the Aspose.BarCode for .NET API to scan QR codes as well as various other types of barcodes. It is a powerful library that can be used to scan QR codes from images or directly from a webcam.
PM> Install-Package Aspose.BarCode
Scan QR Code in C#
We can easily scan a QR code by following the steps below:
- Initialize an object of the BarCodeReader class along with the DecodeType parameter.
- Create an instance of the BarCodeResult class.
- Scan the QR code and get the result text.
The following code sample shows how to scan a QR code in C#.
Scan QR Code from a Stream in C#
We can also read a QR code from a stream by following the steps below:
- Declare an instance of the BarcodeReader class and set the DecodeType property.
- Instantiate a BarCodeResult type object.
- Scan the QR Code and retrieve the output text.
The code sample below shows how to scan a QR code from a stream in C#.
Get a Free License
You can get a free temporary license to test all of the features of the API without any evaluation limitations.
QR Code Scanner Online
You may scan a QR code online using the camera with this free online QR Scanner web app developed using this API.
QR Code Reader – Free Learning Resources
Besides scanning QR codes, learn more about generating and reading barcodes and explore other features of the API using the resources below:
In this article, you have learned how to scan a QR code from a file or a stream with a few API calls. Moreover, we have introduced a web-based tool to scan QR codes online. In case of any ambiguity, please feel free to contact us on our free support forum.