SkiaSharp.QrCode 0.1.0

QrCode for .NET Standard with Skia.Sharp. No GDI, no System.Drawing.

There is a newer version of this package available.
See the version list below for details.
Install-Package SkiaSharp.QrCode -Version 0.1.0
dotnet add package SkiaSharp.QrCode --version 0.1.0
<PackageReference Include="SkiaSharp.QrCode" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SkiaSharp.QrCode --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Skia.QrCode

Qr Code generator with Skia.Sharp.

Install

.NET CLI

$ dotnet add package SkiaQrCode

Package Manager

PM> Install-Pacakge Skia.QrCode

Motivation

There are many ZXing.Net + System.Drawing samples to generate Qr.
If you want avoid System.Drawing, you may use ImageSharp or Core.Compat.System.Drawing.

However using these code required much coding, I just want to create QR!

Why Skia?

.NET Core Image Processing

Sample Code

using SkiaQrCode;
using SkiaSharp;
using System;
using System.IO;

namespace SkiaQrCodeSampleConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var content = "testtesttest";
            using (var generator = new QRCodeGenerator())
            {
                // Generate QrCode
                var qr = generator.CreateQrCode(content, ECCLevel.L);

                // Render to canvas
                var info = new SKImageInfo(512, 512);
                using (var surface = SKSurface.Create(info))
                {
                    var canvas = surface.Canvas;
                    canvas.Render(qr, info.Width, info.Height);

                    // Output to Stream -> File
                    using (var image = surface.Snapshot())
                    using (var data = image.Encode(SKEncodedImageFormat.Png, 100))
                    using (var stream = File.OpenWrite(@"output/hoge.png"))
                    {
                        data.SaveTo(stream);
                    }
                }
            }
        }
    }
}

License

MIT

Thanks

aloisdeniel/Xam.Forms.QRCode : Qr Sample with Skia
codebude/QRCoder : all QRCode generation algorithms

Skia.QrCode

Qr Code generator with Skia.Sharp.

Install

.NET CLI

$ dotnet add package SkiaQrCode

Package Manager

PM> Install-Pacakge Skia.QrCode

Motivation

There are many ZXing.Net + System.Drawing samples to generate Qr.
If you want avoid System.Drawing, you may use ImageSharp or Core.Compat.System.Drawing.

However using these code required much coding, I just want to create QR!

Why Skia?

.NET Core Image Processing

Sample Code

using SkiaQrCode;
using SkiaSharp;
using System;
using System.IO;

namespace SkiaQrCodeSampleConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var content = "testtesttest";
            using (var generator = new QRCodeGenerator())
            {
                // Generate QrCode
                var qr = generator.CreateQrCode(content, ECCLevel.L);

                // Render to canvas
                var info = new SKImageInfo(512, 512);
                using (var surface = SKSurface.Create(info))
                {
                    var canvas = surface.Canvas;
                    canvas.Render(qr, info.Width, info.Height);

                    // Output to Stream -> File
                    using (var image = surface.Snapshot())
                    using (var data = image.Encode(SKEncodedImageFormat.Png, 100))
                    using (var stream = File.OpenWrite(@"output/hoge.png"))
                    {
                        data.SaveTo(stream);
                    }
                }
            }
        }
    }
}

License

MIT

Thanks

aloisdeniel/Xam.Forms.QRCode : Qr Sample with Skia
codebude/QRCoder : all QRCode generation algorithms

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SkiaSharp.QrCode:

Package Downloads
GeekyMonkey.TwoFactorAuthNetSkiaSharpQrProvider
A QR Code provider for TwoFactorAuth.Net that has no external API dependency. The image is generated on your own server. Also no dependency on System.Drawing to avoid installation issues with Linux.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.4.1 1,561 11/25/2020
0.3.2 15,493 3/5/2020
0.3.1 18,408 3/19/2019
0.3.0 276 3/19/2019
0.2.0 724 1/16/2019
0.1.0 251 1/16/2019
Show less