Nerdbank.QRCodes 0.2.9-beta

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
This is a prerelease version of Nerdbank.QRCodes.
dotnet add package Nerdbank.QRCodes --version 0.2.9-beta
NuGet\Install-Package Nerdbank.QRCodes -Version 0.2.9-beta
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nerdbank.QRCodes" Version="0.2.9-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nerdbank.QRCodes --version 0.2.9-beta
#r "nuget: Nerdbank.QRCodes, 0.2.9-beta"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Nerdbank.QRCodes as a Cake Addin
#addin nuget:?package=Nerdbank.QRCodes&version=0.2.9-beta&prerelease

// Install Nerdbank.QRCodes as a Cake Tool
#tool nuget:?package=Nerdbank.QRCodes&version=0.2.9-beta&prerelease

Nerdbank.QRCodes

Features

  • Decode a QR code (using the excellent ZXing.Net library, Windows only) from a high quality render or a photo with a QR code somewhere in the image.
  • Encode data in a QR code (using the excellent QRCoder library) supporting several graphic formats (some Windows only) and even as ASCII art.

Usage

Create a QR code

There are lots of options for customizing QR codes including style, image in the center, colors, and output image format. Following is a basic example.

using QRCoder;

QREncoder encoder = new();
QRCodeGenerator generator = new();
QRCodeData data = generator.CreateQrCode("https://some.url", encoder.ECCLevel);
encoder.Encode(data, "some.png", traceSource: null);

Decode a QR code

Decoding a QR code is very straightforward.

using Bitmap bitmap = (Bitmap)Image.FromFile("some.jpg");
if (QRDecoder.TryDecode(bitmap, out string? data))
{
	Console.WriteLine(data);
}

Today this requires running on Windows.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net7.0-windows7.0 is compatible.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.9-beta 2,627 10/3/2023