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 += $"Type : {obj[i].BarcodeType}, Value : {obj[i].DisplayValue}{Environment.NewLine}";
            }
            Device.BeginInvokeOnMainThread(async() =>
            {
                await DisplayAlert("Result", result, "OK");
                //GoogleVisionBarCodeScanner.Methods.Reset();
                await Navigation.PopModalAsync();
            });
        }
        void CameraView_OnDetected(System.Object sender, GoogleVisionBarCodeScanner.OnDetectedEventArg e)
        {
            var results = e.BarcodeResults;

            var resultString = string.Empty;

            foreach (var barcode in results)
            {
                resultString += $"Type: {barcode.BarcodeType}, Value: {barcode.DisplayValue}{Environment.NewLine}";
            }

            Device.BeginInvokeOnMainThread(async() =>
            {
                await DisplayAlert("Results", resultString, "OK");

                GoogleVisionBarCodeScanner.Methods.SetIsScanning(true);
            });
        }
Exemple #3
0
        private 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}. BarcodeType : {obj[i].BarcodeType}, Barcode : {obj[i].DisplayValue}{Environment.NewLine}";
            }

            Device.BeginInvokeOnMainThread(() =>
            {
                LblBarcodeValue.Text = result;

                //if you want to keep scanning the next barcode, do not close the scanning page and call below function
                GoogleVisionBarCodeScanner.Methods.SetIsScanning(true);
            });
        }