---
title: "C# .NET QR code reader and scanner: Fast and accurate | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/barcodes/read-scan/qr/"
md_url: "https://www.nutrient.io/guides/dotnet/barcodes/read-scan/qr.md"
last_updated: "2026-05-20T07:45:28.967Z"
description: "Discover how to scan QR codes effectively with our comprehensive guide. Learn the best methods and tips to enhance your barcode scanning experience."
---

# Scan and read QR codes in C#

## Reading a QR code from an image

In addition to the general barcode scanning workflow below, you can use this focused QR-specific snippet:

```csharp

using GdPicture14;

LicenseManager licence = new LicenseManager();
licence.RegisterKEY("");

using GdPictureImaging imaging = new GdPictureImaging();
int imageId = imaging.CreateGdPictureImageFromFile(@"input_qr_code.png");
imaging.BarcodeQRReaderDoScan(imageId);
int barcodesCount = imaging.BarcodeQRReaderGetBarcodeCount();
if (barcodesCount > 0)
{
    string barcodeValue = imaging.BarcodeQRReaderGetBarcodeValue(1);
}

```

## Scanning a barcode from an image

Nutrient.NET SDK (formerly GdPicture.NET) enables you to recognize one-dimensional (1D or linear) and two-dimensional (2D) barcodes.

Nutrient.NET SDK supports all 1D barcode formats and the following 2D barcode formats:

- Aztec Code

- Data Matrix

- MaxiCode

- Micro QR

- PDF417

- QR

To recognize QR barcodes and then write their values to the console, follow these steps:

1. Create a `GdPictureImaging` object.

2. Select the image by passing its path to the `CreateGdPictureImageFromFile` method of the `GdPictureImaging` object.

3. Scan the barcodes by passing the image as the parameter of the `BarcodeQRReaderDoScan` method.

4. Determine the number of scanned barcodes and loop through them.

5. Save the value of each barcode.

6. Write the values to the console.

7. Release unnecessary resources.

The example below scans QR barcodes and then writes their values to the console:

### C#

```csharp

using GdPictureImaging gdpictureImaging = new GdPictureImaging();
// Select the image to process.
int imageID = gdpictureImaging.CreateGdPictureImageFromFile(@"C:\temp\source.png");
// Scan the barcodes.
gdpictureImaging.BarcodeQRReaderDoScan(imageID);
// Determine the number of scanned barcodes.
int barcodeCount = gdpictureImaging.BarcodeQRReaderGetBarcodeCount();
string content = "";
if (barcodeCount > 0)
{
    content = "Number of barcodes scanned: " + barcodeCount.ToString();
    // Save the value of each barcode.
    for (int i = 1; i <= barcodeCount; i++)
    {
        content += $"\nBarcode Number: {i} Value: {gdpictureImaging.BarcodeQRReaderGetBarcodeValue(i)}";
    }
}
// Write the values to the console.
Console.WriteLine(content);
// Release unnecessary resources.
gdpictureImaging.BarcodeQRReaderClear();
gdpictureImaging.ReleaseGdPictureImage(imageID);

```

### VB.NET

```vb

Using gdpictureImaging As GdPictureImaging = New GdPictureImaging()
    ' Select the image to process.
    Dim imageID As Integer = gdpictureImaging.CreateGdPictureImageFromFile("C:\temp\source.png")
    ' Scan the barcodes.
    gdpictureImaging.BarcodeQRReaderDoScan(imageID)
    ' Determine the number of scanned barcodes.
    Dim barcodeCount As Integer = gdpictureImaging.BarcodeQRReaderGetBarcodeCount()
    Dim content = ""
    If barcodeCount > 0 Then
        content = "Number of barcodes scanned: " & barcodeCount.ToString()
        ' Save the value of each barcode.
        For i = 1 To barcodeCount
            content = content & vbLf & "Barcode Number: " & i.ToString() & "    Value: " & gdpictureImaging.BarcodeQRReaderGetBarcodeValue(i).ToString()
        Next
    End If
    ' Write the values to the console.
    Console.WriteLine(content);
    ' Release unnecessary resources.
    gdpictureImaging.BarcodeQRReaderClear()
    gdpictureImaging.ReleaseGdPictureImage(imageID)
End Using

```

#### Used methods and properties

- [`BarcodeQRReaderClear`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~BarcodeQRReaderClear.html)

- [`BarcodeQRReaderDoScan`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~BarcodeQRReaderDoScan.html)

- [`BarcodeQRReaderGetBarcodeCount`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~BarcodeQRReaderGetBarcodeCount.html)

- [`BarcodeQRReaderGetBarcodeValue`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~BarcodeQRReaderGetBarcodeValue.html)

- [`CreateGdPictureImageFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~CreateGdPictureImageFromFile.html)

- [`ReleaseGdPictureImage`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~ReleaseGdPictureImage.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

 and  methods.

## Additional options

To determine which types of 1D barcode to scan, use an overload of the [`Barcode1DReaderDoScan`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~Barcode1DReaderDoScan.html) method that accepts members of the [`Barcode1DReaderType`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.Barcode1DReaderType.html) enumeration as its parameter. As a result, GdPicture.NET only scans the types of 1D barcode that you specify.

## Additional options

To determine the version of a QR barcode, pass the index of the barcode to the [`BarcodeQRReaderGetVersion`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~BarcodeQRReaderGetVersion.html) method.

---

## Related pages

- [Scan and read PDF417 barcodes in C#](/guides/dotnet/barcodes/read-scan/pdf417.md)
- [Scan and read Aztec Code in C# .NET](/guides/dotnet/barcodes/read-scan/aztec-code.md)
- [Scan and read 1D (linear) barcodes in C#](/guides/dotnet/barcodes/read-scan/1d-linear.md)
- [Scan, read, and generate Data Matrix barcodes in C#](/guides/dotnet/barcodes/read-scan/datamatrix.md)
- [Scan and read MaxiCode in C# .NET](/guides/dotnet/barcodes/read-scan/maxicode.md)
- [C# barcode reader and scanner library](/guides/dotnet/barcodes/read-scan.md)
- [Scan and read Micro QR codes in C#](/guides/dotnet/barcodes/read-scan/microqr.md)

