Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create barcodes and QRcodes in .NET 6 without System.Drawing.Common?

I have been using ZXing.Net to create barcodes and QRcodes for several years. However, it depends on (more accurately, my implementation of the actual rendering to a BMP depends on) System.Drawing.Common which as of .NET 6.0 is only compatible with windows. As such I can no longer use this library in my .NET 6.0 app when it is hosted in a Docker Linux container.

I have tried to create an image from the ZXing PixelData using Microsoft.Maui.Graphics but have had no luck - the lack of Microsoft.Maui.Graphics documentation at this point doesn't help.

Any ideas on how to create bar codes and QR codes in .NET 6 with using System.Drawing.Common?

like image 741
ProfNimrod Avatar asked Sep 18 '25 11:09

ProfNimrod


1 Answers

However, it depends on System.Drawing.Common that's not correct. ZXing can work with multiple libraries by using the correct binding package. NuGet contains 13 different binding packages including ZXing.Net.Bindings.ImageSharp and ZXing.Net.Bindings.SkiaSharp and

If you check the source code repo in Github you'll see that the bindings to OpenCVSharp, ImageSharp, SkiaSharp, EtoForms and Windows are kept up to date

like image 188
Panagiotis Kanavos Avatar answered Sep 21 '25 02:09

Panagiotis Kanavos