You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the scanview is done loading there is no event to start the toggle of the camera.
Following your example i had to adapt like this else the toggleflashlight would throw a nullreferenceexception.
public MainPage()
{
InitializeComponent();
Task.Run(async() =>
{
await Task.Delay(5000);
GoogleVisionBarCodeScanner.Methods.ToggleFlashlight();
});
}
private async void CameraView_OnDetected(object sender, GoogleVisionBarCodeScanner.OnDetectedEventArg e)
{
List<GoogleVisionBarCodeScanner.BarcodeResult> obj = e.BarcodeResults;
string result = string.Empty;
for (int i = 0; i < obj.Count; i++)
{
result += $"{i + 1}. Type : {obj[i].BarcodeType}, Value : {obj[i].DisplayValue}{Environment.NewLine}";
}
Device.BeginInvokeOnMainThread(async () =>
{
await DisplayAlert("Result", result, "OK");
//await Navigation.PopModalAsync();
});
}
The text was updated successfully, but these errors were encountered:
Hi @JimmyPun610
I have checked the example which has a button, i want the torch to be on automatically when the camera is loaded.
When i try to do this while it's loading i get a nullreference exception.
Hi @christophedemey
I updated the version to 4.2.1(uploading) and added a property named DefaultTorchOn
You may set it to true if you need to switch the light on when opening the page.
Please note that you will need to switch off the light in event OnDisappearing (You can refer to sample), otherwise, torch will not switch off in iOS.
Please let me know if it works, or you may close the issue. Thanks
Hi
When the scanview is done loading there is no event to start the toggle of the camera.
Following your example i had to adapt like this else the toggleflashlight would throw a nullreferenceexception.
The text was updated successfully, but these errors were encountered: