RedCorners.Forms.ZXing
8.47.3
See the version list below for details.
dotnet add package RedCorners.Forms.ZXing --version 8.47.3
NuGet\Install-Package RedCorners.Forms.ZXing -Version 8.47.3
<PackageReference Include="RedCorners.Forms.ZXing" Version="8.47.3" />
paket add RedCorners.Forms.ZXing --version 8.47.3
#r "nuget: RedCorners.Forms.ZXing, 8.47.3"
// Install RedCorners.Forms.ZXing as a Cake Addin
#addin nuget:?package=RedCorners.Forms.ZXing&version=8.47.3
// Install RedCorners.Forms.ZXing as a Cake Tool
#tool nuget:?package=RedCorners.Forms.ZXing&version=8.47.3
RedCorners.Forms.ZXing Changes
This library is a modified version of ZXing.Net.Mobile, with two major differences:
- It contains methods to take pictures, essentially making ZXingScannerView a proper Camera view,
- It does not include the ZXing DLL, and instead references its NuGet package,
- The structure of the project is different and only Android and iOS are supported.
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 UWP. The goal of ZXing.Net.Mobile is to make scanning barcodes as effortless and painless as possible in your own applications.
Usage
The simplest example of using ZXing.Net.Mobile looks something like this:
buttonScan.Click += (sender, e) => {
#if __ANDROID__
// Initialize the scanner first so it can track the current context
MobileBarcodeScanner.Initialize (Application);
#endif
var scanner = new ZXing.Mobile.MobileBarcodeScanner();
var result = await scanner.Scan();
if (result != null)
Console.WriteLine("Scanned Barcode: " + result.Text);
};
Xamarin Forms
For Xamarin Forms there is a bit more setup needed. You will need to initialize the library on each platform in your platform specific app project.
Features
- Xamarin.iOS
- Xamarin.Android
- Simple API - Scan in as little as 2 lines of code!
- Scanner as a View - UIView (iOS) / Fragment (Android) / Control (WP)
Custom Overlays
By default, ZXing.Net.Mobile provides a very simple overlay for your barcode scanning interface. This overlay consists of a horizontal red line centered in the scanning 'window' and semi-transparent borders on the top and bottom of the non-scanning area. You also have the opportunity to customize the top and bottom text that appears in this overlay.
If you want to customize the overlay, you must create your own View for each platform. You can customize your overlay like this:
var scanner = new ZXing.Mobile.MobileBarcodeScanner();
scanner.UseCustomOverlay = true;
scanner.CustomOverlay = myCustomOverlayInstance;
var result = await scanner.Scan();
//Handle result
Keep in mind that when using a Custom Overlay, you are responsible for the entire overlay (you cannot mix and match custom elements with the default overlay). The ZxingScanner instance has a CustomOverlay property, however on each platform this property is of a different type:
- Xamarin.iOS ⇒ UIView
- Xamarin.Android ⇒ View
All of the platform samples have examples of custom overlays.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
MonoAndroid | monoandroid90 is compatible. |
Xamarin.iOS | xamarinios10 is compatible. |
-
MonoAndroid 9.0
- FastAndroidCamera (>= 2.0.0)
- Xamarin.Android.Support.v7.AppCompat (>= 28.0.0.3)
- Xamarin.Essentials (>= 1.5.3.1)
- Xamarin.Forms (>= 4.6.0.726)
- ZXing.Net (>= 0.16.5)
-
Xamarin.iOS 1.0
- Xamarin.Essentials (>= 1.5.3.1)
- Xamarin.Forms (>= 4.6.0.726)
- ZXing.Net (>= 0.16.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RedCorners.Forms.ZXing:
Package | Downloads |
---|---|
RedCorners.Forms.CameraView
A CameraView control for Xamarin.Forms (iOS and Android), based on ZXing.Net by Redth |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
9.0.1 | 415 | 8/18/2022 |
9.0.0 | 354 | 8/18/2022 |
8.47.3 | 616 | 5/20/2020 |
8.47.2-alpha | 317 | 5/12/2020 |
8.47.1-alpha | 323 | 5/8/2020 |
Fork of Redth/ZXing.Net.Mobile adding extra camera features.