IRONSOFTWAREHOME
WPF QR Code Scanner
using IronQr;
using IronSoftware.Drawing;
using Microsoft.Win32;

// Open a file dialog to select a QR code image
var dialog = new OpenFileDialog
{
    Title = "Select a QR code image",
    Filter = "Image Files|*.png;*.jpg;*.jpeg;*.bmp;*.gif;*.tiff"
};

if (dialog.ShowDialog() == true)
{
    // Load the selected image into IronQR
    var inputBmp = AnyBitmap.FromFile(dialog.FileName);
    QrImageInput imageInput = new QrImageInput(inputBmp);

    // Create a QR Reader object and read the image
    QrReader reader = new QrReader();
    IEnumerable<QrResult> results = reader.Read(imageInput);

    // Display the first result
    ResultLabel.Text = results.FirstOrDefault()?.Value ?? "No QR code found.";
}
Imports IronQr
Imports IronSoftware.Drawing
Imports Microsoft.Win32

' Open a file dialog to select a QR code image
Dim dialog = New OpenFileDialog With {
    .Title = "Select a QR code image",
    .Filter = "Image Files|*.png;*.jpg;*.jpeg;*.bmp;*.gif;*.tiff"
}

If dialog.ShowDialog() = True Then
    ' Load the selected image into IronQR
    Dim inputBmp = AnyBitmap.FromFile(dialog.FileName)
    Dim imageInput As New QrImageInput(inputBmp)

    ' Create a QR Reader object and read the image
    Dim reader As New QrReader()
    Dim results As IEnumerable(Of QrResult) = reader.Read(imageInput)

    ' Display the first result
    ResultLabel.Text = If(results.FirstOrDefault()?.Value, "No QR code found.")
End If
NuGet Download
PM > Install-Package IronQR
WPF QR Code Scanner

WPF QR Code Scanner

Use IronQR to scan QR codes in a WPF desktop application. Open an image file with the native OpenFileDialog, load it using AnyBitmap.FromFile, and decode it with QrReader.Read. No JavaScript or browser needed.

5-step guide for scanning a QR code in WPF

  • using IronQr;
  • using IronSoftware.Drawing;
  • var dialog = new OpenFileDialog { Filter = "Image Files|.png;.jpg;.jpeg;.bmp" };
  • var inputBmp = AnyBitmap.FromFile(dialog.FileName);
  • var results = reader.Read(imageInput/);

Code Explanation

OpenFileDialog handles native Windows file selection filtered to common image types. AnyBitmap.FromFile loads the chosen file into a bitmap regardless of format. A QrImageInput wraps that bitmap so IronQR can work with it, and QrReader.Read returns an IEnumerable<QrResult> with one entry for each QR code found in the image. FirstOrDefault grabs the first result safely, so the app does not crash if the image has no QR code.

Discover How to Build a WPF QR Code Scanner with IronQR.

Ready to Get Started?

Nuget Downloads 74,386Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required