Lyo.QRCode.QRCoder
1.0.3
dotnet add package Lyo.QRCode.QRCoder --version 1.0.3
NuGet\Install-Package Lyo.QRCode.QRCoder -Version 1.0.3
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="Lyo.QRCode.QRCoder" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.QRCode.QRCoder" Version="1.0.3" />
<PackageReference Include="Lyo.QRCode.QRCoder" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lyo.QRCode.QRCoder --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Lyo.QRCode.QRCoder, 1.0.3"
#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.
#:package Lyo.QRCode.QRCoder@1.0.3
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lyo.QRCode.QRCoder&version=1.0.3
#tool nuget:?package=Lyo.QRCode.QRCoder&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Lyo.QRCode.QRCoder
QRCoder-backed implementation of IQRCodeService from Lyo.QRCode. Pick this when you need JPEG / Bitmap output on Windows or want to use QRCoder's mature renderers; pick the built-in BuiltInQRCodeService when you want the in-library ISO encoder with no extra NuGet.
Examples
Usage
using Lyo.QRCode;
using Lyo.QRCode.Models;
using Lyo.QRCode.QRCoder;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddQRCoderQrCodeService(o => {
o.DefaultSize = 16; // pixels per module
o.DefaultFormat = QRCodeFormat.Png; // Jpeg / Bmp also supported via QRCoder
o.DefaultErrorCorrectionLevel = QRCodeErrorCorrectionLevel.Medium;
});
var qr = services.BuildServiceProvider().GetRequiredService<IQRCodeService>();
var result = await qr.GenerateAsync("https://example.com");
Configuration binding
services.AddQRCoderQrCodeServiceFromConfiguration(builder.Configuration);
Configuration binding (2)
{
"QRCodeService": {
"DefaultSize": 16,
"DefaultFormat": "Png",
"DefaultErrorCorrectionLevel": "Medium",
"MinSize": 1,
"MaxSize": 2000,
"EnableMetrics": false
}
}
Public API
| Type | Description |
|---|---|
QRCoderQRCodeService |
IQRCodeService implementation. No image dependencies — decoration (logo, frame, caption, padding) is the consumer's job via Lyo.Images.IImageDecorationService. |
QRCoderQrCodeServiceExtensions |
DI: AddQRCoderQrCodeService(Action<QRCodeServiceOptions>?), AddQRCoderQrCodeService(QRCodeServiceOptions), AddQRCoderQrCodeServiceFromConfiguration(IConfiguration, sectionName?). |
Notes
- JPEG / Bitmap outputs go through
System.Drawingand are only fully supported on Windows; PNG/SVG paths run cross-platform. - Decoding (
ReadFromImageAsync) usesQRCodeZxingReadin this package (ZXing.Net + ImageSharp), same as the built-in service. - Decoration is out of scope: the QRCoder service no longer applies center logos or frames. Pipe the returned bytes through
Lyo.Images.IImageDecorationService.Pipeline(...)and callOverlay/AddFrame/AddCaption/AddOuterPaddingas needed (see theLyo.ImagesREADME).
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.QRCode— (direct, lyo)Lyo.Result— (direct, lyo)Microsoft.Extensions.Configuration.Binder10.0.5— (direct, microsoft)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5— (direct, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5— (direct, microsoft)QRCoder1.8.0— (direct, third-party)Lyo.Common— (transitive, lyo)Lyo.Exceptions— (transitive, lyo)Lyo.Metrics— (transitive, lyo)Microsoft.Extensions.Options.ConfigurationExtensions10.0.5— (transitive, microsoft)SixLabors.ImageSharp3.1.12— (transitive, third-party)System.Memory4.6.3— (transitive, microsoft, netstandard2.0)System.Text.Json10.0.5— (transitive, microsoft, netstandard2.0)ZXing.Net0.16.11— (transitive, third-party)ZXing.Net.Bindings.ImageSharp.V30.16.18— (transitive, third-party)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Lyo.QRCode (>= 1.0.3)
- Lyo.Result (>= 1.0.3)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- QRCoder (>= 1.8.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.