Open ThomasCarltonInPerson opened 1 year ago
@ThomasCarltonInPerson I just wrote a little prototype without Shell, using ZXing.Net.Maui.Controls
in version 0.3.0-preview.1
. It was working fine for me. The only difference to your solution: I was placing CameraBarcodeReaderView
not directly on MainPage
.
In App.xaml.cs
:
MainPage = new NavigationPage(new MainPage());
In MainPage.xaml.cs
:
var scanPage = new ScanPage();
await Navigation.PushAsync(scanPage);
In ScanPage.xaml.cs
:
const BarcodeFormat formatsToRecognize = BarcodeFormat.Code39;
CameraBarcodeReaderView.Options = new BarcodeReaderOptions
{
AutoRotate = true,
Formats = formatsToRecognize,
Multiple = false,
TryHarder = true,
TryInverted = false
};
CameraBarcodeReaderView.CameraLocation = CameraLocation.Rear;
CameraBarcodeReaderView.IsTorchOn = false;
CameraBarcodeReaderView.IsDetecting = true;
CameraBarcodeReaderView.BarcodesDetected += (_, args) =>
{
// Handle results
};
Maybe your code is not working because you are not setting IsDetecting = true
?
Hello community,
I tried using ZXing.Net.Maui scanner in an empty app.
I seems like it doesn't work if the app doesn't use shell.
Here is my app class code :
The scanner works if the app is initialized using this code :
` namespace MauiApp1;
`
However if the app is initialized using this code, it doesn't work. The camera view is just black and doesn't shod the camera feed.
` namespace MauiApp1;
`
In both cases I'm creating the scanner by following the different steps in the documentation :
` <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:zxing="clr-namespace:ZXing.Net.Maui.Controls;assembly=ZXing.Net.MAUI" x:Class="MauiApp1.MainPage">
`
` using ZXing.Net.Maui; namespace MauiApp1;
`
Does anyone know what am I doing wrong please ? My app doesn't use Shell. So I'm unable to use the scanner.
Thanks. Cheers,