------------------------------OBSOLETE-----------------------------------------------
this project (and associated package) have no reason to live anymore, since the original project ZXing.Net.Maui (https://github.com/Redth/ZXing.Net.Maui) was corrected and a package published.
Please Fork the original repository instead of this one, same thing for opening issues
The successor to ZXing.Net.Mobile
<zxing:CameraBarcodeReaderView
x:Name="cameraBarcodeReaderView"
BarcodesDetected="BarcodesDetected" />
Configure Reader options
cameraBarcodeReaderView.Options = new BarcodeReaderOptions
{
Formats = BarcodeFormats.OneDimensional,
AutoRotate = true,
Multiple = true
};
Toggle Torch
cameraBarcodeReaderView.IsTorchOn = !cameraBarcodeReaderView.IsTorchOn;
Flip between Rear/Front cameras
cameraBarcodeReaderView.CameraLocation
= cameraBarcodeReaderView.CameraLocation == CameraLocation.Rear ? CameraLocation.Front : CameraLocation.Rear;
Handle detected barcode(s)
protected void BarcodesDetected(object sender, BarcodeDetectionEventArgs e)
{
foreach (var barcode in e.Results)
Console.WriteLine($"Barcodes: {barcode.Format} -> {barcode.Value}");
}
<zxing:BarcodeGeneratorView
HeightRequest="100"
WidthRequest="100"
ForegroundColor="DarkBlue"
Value="https://dotnet.microsoft.com"
Format="QrCode"
Margin="3" />