Skip to content

Now unable to use SvgQRCode and SvgLogo #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JamesHill3 opened this issue Dec 13, 2021 · 1 comment
Closed

Now unable to use SvgQRCode and SvgLogo #362

JamesHill3 opened this issue Dec 13, 2021 · 1 comment

Comments

@JamesHill3
Copy link

JamesHill3 commented Dec 13, 2021

Type of issue

[ ] Bug
[ ] Question (e.g. about handling/usage)
[x] Request for new feature/improvement

Expected Behavior

Prior to version 1.4.3 I was using both SvgQRCode and SvgLogo to generate a QR code in a class library (this worked for some time):

image

Current Behavior

With the 1.4.3 update, SvgQRCode, SvgLogo, and the SizingMode enum are no longer available to me.

// Generate QR code
QRCodeGenerator qrGenerator = new();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(qrCodeUrl, QRCodeGenerator.ECCLevel.Q);
SvgQRCode qrCode = new(qrCodeData);
var svgLogo = new SvgLogo("<svg>raw svg here</svg>", 15, true, true);

return qrCode.GetGraphic(new Size(75, 75), true, SizingMode.ViewBoxAttribute, svgLogo);

Your Environment

Visual Studio 2022
Class library targeting .Net 6 with no target OS

Desired outcome

It would be fantastic if this functionality could be restored.

@codebude
Copy link
Owner

codebude commented Dec 13, 2021

Hello @JamesHill3 ,

this is the result of Microsoft's decision to drop support for System.Drawing in .NET 6.0 for non-Windows targeting apps. Please check my answer in #361 for a more detailed explanation.
If you have any questions that aren't answered by the aforementioned comment, let me know. I'm happy to help.

p.s.: You can find an targetplatform-compatibility overview for the rendering classes in our wiki: https://github.com/codebude/QRCoder/wiki/Advanced-usage---QR-Code-renderers#2-overview-of-the-different-renderers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants