huysentruitw / barcoder

Lightweight Barcode Encoding Library for .NET Framework, .NET Standard and .NET Core.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QR Code render thows an exception

tinohager opened this issue · comments

I installed these two packages as described in the documentation, the error thows in my netcoreapp3.1

  • Barcoder
  • Barcoder.Renderer.Image
var barcode = QrEncoder.Encode(qrcode.Content, Barcoder.Qr.ErrorCorrectionLevel.M, Encoding.Auto);
var renderer = new ImageRenderer(imageFormat: Barcoder.Renderer.Image.ImageFormat.Png);

using (var ms = new MemoryStream())
{
	renderer.Render(barcode, ms);
	var imageData = ms.ToArray();
	this._skCanvas.DrawBitmap(SKBitmap.Decode(imageData), x, y);
}

image

This library is still depending on a beta version of the SixLabors.ImageSharp package. I think we should update it to a non-beta release if that's possible before trying anything else.

Apart from that, I think this error can happen when your project also references the same NuGet package, but a different version.

On a clean project it works.

image