Use IronQR to scan QR codes in a Blazor Server application. Upload an image through the browser with Blazor's InputFile component, then decode it server-side with QrReader.Read().
5-step guide for scanning a QR code in Blazor
using IronQr;using IronSoftware.Drawing;await using var stream = file.OpenReadStream(maxAllowedSize: 10_000_000);var inputBmp = AnyBitmap.FromFile(qrImageSrc!);var results = reader.Read(imageInput);
Code Explanation
InputFile.OnChange fires when the user selects a file. OpenReadStream streams the browser upload to a temporary server path, which is then passed to AnyBitmap.FromFile to decode the image format. A QrImageInput wraps the bitmap for IronQR, and QrReader.Read returns an IEnumerable<QrResult>. FirstOrDefault safely retrieves the first result without throwing on images that contain no QR code.