如何在没有 System.Drawing.Common 的情况下在 .NET 6 中创建条形码和二维码?

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

多年来,我一直在使用 ZXing.Net 创建条形码和二维码。但是,它取决于(更准确地说,我对 BMP 的实际渲染的实现取决于)System.Drawing.Common,从 .NET 6.0 开始,它仅与 windows 兼容。因此,当它托管在 Docker Linux 容器中时,我不能再在我的 .NET 6.0 应用程序中使用它。

我曾尝试使用 Microsoft.Maui.Graphics 从 ZXing PixelData 创建图像,但没有成功 - 此时缺少 Microsoft.Maui.Graphics 文档无济于事。

关于如何使用 System.Drawing.Common 在 .NET 6 中创建条形码和 QR 码有什么想法吗?

However, it depends on System.Drawing.Common 这是不正确的。 ZXing 可以通过使用正确的绑定包来处理多个库。 NuGet 包含 13 different binding packages including ZXing.Net.Bindings.ImageSharp and ZXing.Net.Bindings.SkiaSharp

如果您检查 the source code repo in Github,您会看到与 OpenCVSharp、ImageSharp、SkiaSharp、EtoForms 和 Windows 的绑定保持最新