public CameraAnalyzer(SurfaceView surfaceView, MobileBarcodeScanningOptions scanningOptions) { _scanningOptions = scanningOptions; _cameraEventListener = new CameraEventsListener(); _cameraController = new CameraController(surfaceView, _cameraEventListener, scanningOptions); Torch = new Torch(_cameraController, surfaceView.Context); }
public CameraController(SurfaceView surfaceView, CameraEventsListener cameraEventListener, MobileBarcodeScanningOptions scanningOptions) { _context = surfaceView.Context; _holder = surfaceView.Holder; _surfaceView = surfaceView; _cameraEventListener = cameraEventListener; _scanningOptions = scanningOptions; }
public async Task <string> ScanAsync() { var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Scan the QR Code", BottomText = "Please Wait", }; var scanResult = await scanner.Scan(optionsCustom); return(scanResult.Text); }
async Task <string> IQrReaderService.ScannAsync() { var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Lütfen QR Kodu Okutun", BottomText = "Bekleyin...", }; var scanResult = await scanner.Scan(context, optionsCustom); return(scanResult.Text); }
public async Task <string> ScanAsync() { var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Scan the QR Code", BottomText = "Line up the QR code to scan it \n With your devices camera", }; var scanResult = await scanner.Scan(optionsCustom); return(scanResult.Text); }
public async Task <string> ScanAsync() { var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Сканировать QR-код", BottomText = "Идёт сканирование...", }; var scanResult = await scanner.Scan(optionsCustom); return(scanResult.Text); }
public async Task <string> ScanAsync() { var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Scan QR Code", BottomText = "Only QR Code" }; var scanResults = await scanner.Scan(optionsCustom); return(scanResults == null ? null :scanResults.Text); }
public async Task <string> ScanAsync() { var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Scan the sign QR code", CancelButtonText = "Cancel" }; var scanResult = await scanner.Scan(optionsCustom); return(scanResult.Text); }
public async Task <string> ScanAsync() { var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Сканирование QR кода", BottomText = "Пожалуйста подождите", }; var scanResult = await scanner.Scan(optionsCustom); return(scanResult.Text); }
public async Task <string> ScanAsync() { var options = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Scanear o QR Code", BottomText = "Por favor espere", CancelButtonText = "Cancelar" }; var scanResult = await scanner.Scan(options); return(scanResult.Text); }
public async Task <string> ScanAsync() { //var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Escanear cógido QR", BottomText = "Analizando ...", }; var scanResult = await scanner.Scan(optionsCustom); return(scanResult.Text); }
public async Task <string> ScanAsync() { var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions() { }; var scanner = new MobileBarcodeScanner() { TopText = "Barkodu okutunuz", BottomText = "Barkodu okutunuz" }; var scanResult = await scanner.Scan(optionsCustom); return((scanResult != null) ? scanResult.Text : string.Empty); }
public async Task <string> ScanAsync() { var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Escaneé el codigo QR", BottomText = "Porfavor espere", }; var scanResult = await scanner.Scan(optionsCustom); return(scanResult.Text); }
public CustomScannerViewController(MobileBarcodeScanningOptions options, MobileBarcodeScanner scanner) { options.PossibleFormats = new System.Collections.Generic.List <ZXing.BarcodeFormat> { ZXing.BarcodeFormat.QR_CODE, ZXing.BarcodeFormat.EAN_13, ZXing.BarcodeFormat.EAN_8 }; this.ScanningOptions = options; this.Scanner = scanner; CGRect appFrame = UIScreen.MainScreen.Bounds; this.View.Frame = new CGRect(0, 0, appFrame.Width, appFrame.Height); this.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; }
public void ScanProduct() { var opt = new MobileBarcodeScanningOptions(); opt.DelayBetweenContinuousScans = 3000; // Reset scanner ScanStatus(false); scanner.Torch(false); torchFab.SetImageDrawable(ContextCompat.GetDrawable(Activity, Resource.Drawable.ic_flash_on_white_24dp)); // Start scanning scanner.ScanContinuously(opt, HandleScanResult); }
private void LaunchScanner(object sender, EventArgs e) { MobileBarcodeScanner.Initialize(Application); _scanner = new MobileBarcodeScanner { FlashButtonText = "Flash", TopText = "Hold camera up to barcode to scan", BottomText = "Barcode will automatically scan" }; _option = new MobileBarcodeScanningOptions { DelayBetweenContinuousScans = 1000 }; _scanner.ScanContinuously(_option, HandleScanResult); }
public async Task <string> ScanAsync() { var optionDefault = new MobileBarcodeScanningOptions(); var optionCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Acerca la Camara al elemento", BottomText = "Toca la pantalla para enfocar", }; var scanResult = await scanner.Scan(optionCustom); return(scanResult.Text); }
public async Task <string> ScanAsync() { var optionDefault = new MobileBarcodeScanningOptions(); var optionCustom = new MobileBarcodeScanningOptions(); var Scanner = new MobileBarcodeScanner() { TopText = "Acerca la camara al codigo", BottomText = "Toca la pantalla para enfocar" }; var scanResult = await Scanner.Scan(optionCustom); return((scanResult != null) ? scanResult.Text : string.Empty); }
public async Task <string> ScanAsync() { var optionsDefault = new MobileBarcodeScanningOptions(); var optionsCustom = new MobileBarcodeScanningOptions(); var scanner = new MobileBarcodeScanner() { TopText = "Traga a câmera para mais perto do elemento", BottomText = "Toque na tela para focar", }; var scanResult = await scanner.Scan(optionsCustom); return(scanResult.Text); }
public HomePage() : base() { buttonScanDefaultOverlay = new Button { Text = "Scan Barcode", AutomationId = "scanWithDefaultOverlay", }; //setup options var options = new MobileBarcodeScanningOptions { AutoRotate = false, UseFrontCameraIfAvailable = false, TryHarder = true, //PossibleFormats = new List<ZXing.BarcodeFormat> //{ // ZXing.BarcodeFormat.EAN_8, // ZXing.BarcodeFormat.EAN_13 //} }; buttonScanDefaultOverlay.Clicked += async delegate { scanPage = new ZXingScannerPage(options) { DefaultOverlayTopText = "Align the barcode within the frame", DefaultOverlayBottomText = "Scan the Barcode", DefaultOverlayShowFlashButton = true }; scanPage.OnScanResult += (result) => { scanPage.IsScanning = false; ZXing.BarcodeFormat barcodeFormat = result.BarcodeFormat; string type = barcodeFormat.ToString(); Device.BeginInvokeOnMainThread(() => { Navigation.PopAsync(); DisplayAlert("The Barcode type is : " + type, "The text is : " + result.Text, "OK"); }); }; await Navigation.PushAsync(scanPage); }; var stack = new StackLayout(); stack.Children.Add(buttonScanDefaultOverlay); Content = stack; }
public void StartScanning(Action <Result> scanResultHandler, MobileBarcodeScanningOptions options = null) { if (!stopped) { return; } stopped = false; var perf = PerformanceCounter.Start(); Setup(this.Frame); this.ScanningOptions = options ?? MobileBarcodeScanningOptions.Default; this.resultCallback = scanResultHandler; Console.WriteLine("StartScanning"); this.InvokeOnMainThread(() => { if (!SetupCaptureSession()) { //Setup 'simulated' view: Console.WriteLine("Capture Session FAILED"); } if (Runtime.Arch == Arch.SIMULATOR) { var simView = new UIView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height)); simView.BackgroundColor = UIColor.LightGray; simView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; this.InsertSubview(simView, 0); } }); if (!analyzing) { analyzing = true; } PerformanceCounter.Stop(perf, "PERF: StartScanning() Took {0} ms."); var evt = this.OnScannerSetupComplete; if (evt != null) { evt(); } }
private async void Button_Click(object sender, RoutedEventArgs e) { MobileBarcodeScanningOptions options = new MobileBarcodeScanningOptions(); options.PossibleFormats = new List <BarcodeFormat>() { BarcodeFormat.QR_CODE }; MobileBarcodeScanner scanner = new MobileBarcodeScanner(); Result result = await scanner.Scan(options); if (result != null) { Frame.Navigate(typeof(ResultPage), result.Text); } }
public QRScanService() { options = new MobileBarcodeScanningOptions() { UseFrontCameraIfAvailable = false, PossibleFormats = new List <BarcodeFormat>() { BarcodeFormat.QR_CODE } }; scanner = new MobileBarcodeScanner() { TopText = "Aproxime o crachá para fazer a leitura", BottomText = "Toque na tela para focar" }; }
public QRCodeScannerService() { try { Options = new MobileBarcodeScanningOptions(); Scanner = new MobileBarcodeScanner() { TopText = "Escaneie o QRCode na embalagem do seu sensor" }; } catch (System.Exception ex) { string title = this.GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name; BalizaFacil.App.Instance.UnhandledException(title, ex); } }
private async void Scan() { MobileBarcodeScanningOptions options = new MobileBarcodeScanningOptions(); options.AutoRotate = false; var scanner = new MobileBarcodeScanner(); scanner.AutoFocus(); var result = await scanner.Scan(options); if (result != null) { searchView.SetQuery(result.Text, true); } }
async void CameraButton_Click(object sender, EventArgs e) { var scanner = new MobileBarcodeScanner(); var options = new MobileBarcodeScanningOptions { PossibleFormats = new List <BarcodeFormat> { BarcodeFormat.QR_CODE } }; var result = await scanner.Scan(options); if (result != null) { FindViewById <TextView>(Resource.Id.MainMenuInfo).Text = "Scanned Barcode: " + result.Text; } }
public async Task <string> ScanAsync() { var optionsCustom = new MobileBarcodeScanningOptions() { //UseFrontCameraIfAvailable = true }; var scanner = new MobileBarcodeScanner() { TopText = "Aproxime a câmera do código de barra", BottomText = "Toque na tela para focar" }; var scanResults = await scanner.Scan(optionsCustom); return((scanResults != null) ? scanResults.Text : string.Empty); }
public App() { var scannedLabel = new Label { Text = "Scanned Value", HeightRequest = 50, }; var scan = new ScannerView { HeightRequest = 400, WidthRequest = 400, CornerRadius = 20, }; var btn = new Button { Text = "Push To start scanner", HeightRequest = 50, }; scan.OnCancelPressed = () => scannedLabel.Text = "Canceled"; var options = new MobileBarcodeScanningOptions(); options.UseFrontCameraIfAvailable = true; options.PossibleFormats = new List <ZXing.BarcodeFormat> { ZXing.BarcodeFormat.QR_CODE }; btn.Clicked += (s, e) => { scan.StartScanner((res) => { scan.StopScanner(); scannedLabel.Text = res.Text; }, options); }; // The root page of your application MainPage = new ContentPage { Content = new StackLayout { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Children = { scan, scannedLabel, btn } } }; }
public ZXingScannerPage(MobileBarcodeScanningOptions options = null, View customOverlay = null) : base() { zxing = new ZXingScannerView { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Options = options }; zxing.OnScanResult += (result) => { var eh = this.OnScanResult; if (eh != null) { eh(result); } //Device.BeginInvokeOnMainThread (() => eh (result)); }; if (customOverlay == null) { defaultOverlay = new ZXingDefaultOverlay { TopText = "Hold your phone up to the barcode", BottomText = "Scanning will happen automatically", ShowFlashButton = zxing.HasTorch, }; defaultOverlay.FlashButtonClicked += (sender, e) => { zxing.IsTorchOn = !zxing.IsTorchOn; }; Overlay = defaultOverlay; } else { Overlay = customOverlay; } var grid = new Grid { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, }; grid.Children.Add(zxing); grid.Children.Add(Overlay); // The root page of your application Content = grid; }
public async Task getScanner() { var options = new MobileBarcodeScanningOptions { AutoRotate = false, TryHarder = true }; var overlay = new ZXingDefaultOverlay { ShowFlashButton = false, TopText = "Barkodu bu alan içerisinde tutunuz.", Opacity = 0.90 }; overlay.BindingContext = overlay; scanPage = new ZXingScannerPage(options, overlay) { DefaultOverlayShowFlashButton = true, Title = "Barkod Okuyucu" }; scanPage.OnScanResult += (result) => { scanPage.IsScanning = true; Device.BeginInvokeOnMainThread(async() => { try { var model = await GetProduct(result.Text); Application.Current.Properties["ProductId"] = model.ProductId; Application.Current.Properties["ProductWeight"] = model.ProductWeight; Application.Current.Properties["ProductPrice"] = model.ProductPrice; Application.Current.Properties["ProductUrl"] = model.ProductUrl; await Navigation.PushAsync(new Detail(model)); } catch { await DisplayAlert("Hata", "Belirtilen ürün bulunamamaktadır.", "Geri"); } }); }; await Navigation.PushAsync(scanPage); }
private async Task ScanQRCode() { var options = new MobileBarcodeScanningOptions { PossibleFormats = new List <BarcodeFormat> { BarcodeFormat.QR_CODE } }; var result = await _barcodeScanner.Scan(options); if (result == null) { return; } Authenticator auth; try { auth = Authenticator.FromKeyUri(result.Text); } catch { ShowSnackbar(Resource.String.qrCodeFormatError, Snackbar.LengthShort); return; } if (_authenticatorSource.IsDuplicate(auth)) { ShowSnackbar(Resource.String.duplicateAuthenticator, Snackbar.LengthShort); return; } await _connection.InsertAsync(auth); await _authenticatorSource.Update(); await SwitchCategory(null); CheckEmptyState(); var position = _authenticatorSource.GetPosition(auth.Secret); _authenticatorListAdapter.NotifyItemInserted(position); _authList.SmoothScrollToPosition(position); await NotifyWearAppOfChange(); }
public CMPZXingQR() { _qrCodeWriter = new BarcodeWriter() { Format = ZXing.BarcodeFormat.QR_CODE }; _qrScanner = new MobileBarcodeScanner(); _qrScannerOptions = new MobileBarcodeScanningOptions() { PossibleFormats = new List <ZXing.BarcodeFormat>() { ZXing.BarcodeFormat.QR_CODE }, AutoRotate = true }; }