ZXing.Net
0.16.11
dotnet add package ZXing.Net --version 0.16.11
NuGet\Install-Package ZXing.Net -Version 0.16.11
<PackageReference Include="ZXing.Net" Version="0.16.11" />
<PackageVersion Include="ZXing.Net" Version="0.16.11" />
<PackageReference Include="ZXing.Net" />
paket add ZXing.Net --version 0.16.11
#r "nuget: ZXing.Net, 0.16.11"
#:package ZXing.Net@0.16.11
#addin nuget:?package=ZXing.Net&version=0.16.11
#tool nuget:?package=ZXing.Net&version=0.16.11
About
A library which supports decoding and generating of barcodes (like QR Code, PDF 417, EAN, UPC, Aztec, Data Matrix, Codabar) within images.
How to Use
The source code repository includes small examples for Windows Forms, Silverlight, Windows Phone and other project types.
The following example works with the classic .Net framework until version 4.8.1:
// create a barcode reader instance
IBarcodeReader reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
txtDecoderType.Text = result.BarcodeFormat.ToString();
txtDecoderContent.Text = result.Text;
}
If you want to try the sample code above within a project which target .Net Standard or .Net 5.0 or higher then you have to add one of the additional nuget package for a specific image library: https://www.nuget.org/packages?q=ZXing.Bindings The main package of ZXing.Net for such platforms only contains the core classes which are not dependent on a specific assembly for image formats.
// example shows a simple decoding snippet as a .Net 8.0 console appliation which uses the ZXing.Windows.Compatibility package
using System.Drawing;
using ZXing.Windows.Compatibility;
// create a barcode reader instance
var reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
Console.WriteLine(result.BarcodeFormat.ToString());
Console.WriteLine(result.Text);
}
else
{
Console.WriteLine("No barcode found");
}
Related Packages
There are several packages which can be used with different image libraries in combination with ZXing.Net. https://www.nuget.org/packages?q=ZXing.Bindings
Feedback
Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 is compatible. netcoreapp3.1 is compatible. |
| .NET Standard | netstandard1.0 is compatible. netstandard1.1 is compatible. netstandard1.2 was computed. netstandard1.3 is compatible. netstandard1.4 was computed. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net20 is compatible. net20-cf is compatible. net35 is compatible. net35-cf is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 is compatible. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| native | native is compatible. |
| Silverlight | sl3-wp is compatible. sl4 is compatible. sl4-wp71 is compatible. sl5 is compatible. |
| Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
| Universal Windows Platform | uap was computed. uap10 is compatible. uap10.0 was computed. |
| Windows Phone | wp8 is compatible. wp81 was computed. wpa81 was computed. |
| Windows Store | netcore was computed. netcore45 was computed. netcore451 was computed. win8 is compatible. win8-managed is compatible. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.0
- No dependencies.
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 2.0
- No dependencies.
-
.NETFramework 2.0 CompactFramework
- No dependencies.
-
.NETFramework 3.5
- No dependencies.
-
.NETFramework 3.5 CompactFramework
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
.NETFramework 4.5
- No dependencies.
-
.NETFramework 4.6.1
- No dependencies.
-
.NETFramework 4.7
- No dependencies.
-
.NETFramework 4.8
- No dependencies.
-
.NETStandard 1.0
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 1.1
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 2.0
- NETStandard.Library (>= 2.0.0)
-
.NETStandard 2.1
- NETStandard.Library (>= 2.0.0)
-
native 0.0
- No dependencies.
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
-
Portable Class Library (.NETFramework 4.0, Silverlight 4.0, Silverlight 5.0, Windows 0.0, WindowsPhone 7.0, WindowsPhone 7.1, WindowsPhone 8.0)
- No dependencies.
-
Silverlight 3.0 WindowsPhone
- No dependencies.
-
Silverlight 4.0
- No dependencies.
-
Silverlight 4.0 WindowsPhone71
- No dependencies.
-
Silverlight 5.0
- No dependencies.
-
UAP 1.0
- No dependencies.
-
Windows 8.0
- No dependencies.
-
Windows 8.0 managed
- No dependencies.
-
WindowsPhone 8.0
- No dependencies.
NuGet packages (364)
Showing the top 5 NuGet packages that depend on ZXing.Net:
| Package | Downloads |
|---|---|
|
ZXing.Net.Mobile
ZXing.Net.Mobile is a C#/.NET library based on the open source Barcode Library: ZXing (Zebra Crossing), using the ZXing.Net Port. It works with Xamarin.iOS, Xamarin.Android, Tizen and Windows Universal (UWP). The goal of ZXing.Net.Mobile is to make scanning barcodes as effortless and painless as possible in your own applications. See https://github.com/Redth/ZXing.Net.Mobile/releases for release notes. |
|
|
ZXing.Net.Bindings.SkiaSharp
ZXing.Net Bindings for SkiaSharp - use SkiaSharp with ZXing.Net for barcode reading |
|
| ZXing.Net.Mobile.Forms |