Decode QRCode in .NET6 #456
-
Hello Everyone, I'm trying to implement decoding of QRCode in my .NET6 application using ZXing.Net and have below questions:
Here is my code: string[] files = Directory.GetFiles("wwwroot/qrr");
} I have downloaded latest Nuget package for .NET6 and Decode method is not working anymore. Can someone please help me out? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I've had a similar problem (except the opposite way around - where I'm encoding/writing). If I'm representing the answer correctly, the .NET packages are split out somewhat. With the core of ZXing being in the package you've probably already downloaded, but with things like the bitmap handlers in their own packages for different configurations or operating systems. Try incorporating: Though their are other choices if you search "ZXing.Net.Bindings" within NuGet (for example, if you're using Android). I'm very new at this. So decoding may be a separate solution. |
Beta Was this translation helpful? Give feedback.
-
@Woetoo is right. |
Beta Was this translation helpful? Give feedback.
@Woetoo is right.
The .Net Framework until version 4.8 contains the implementation of System.Drawing.Bitmap. The default implementations of the BarcodeReader and BarcodeWriter classes use that type. So your sample works only with the main ZXing.Net package until version 4.8 of the .Net framework.
.Net Standard, .Net Core and .Net 5.0 and above change significantly. The core framework doesn't include a Bitmap class.
So the ZXing.Net base package for the framework versions doesn't contain a reader or writer class for Bitmaps.
The implementations for specific image manipulation libraries are now in separate packages (ZXing.Net.Bindings.*).
You have to select the package which fit your needs.…