예제 #1
0
        async void initSettings()
        {
            IBarcodePicker picker = ScanditService.BarcodePicker;

            // The scanning behavior of the barcode picker is configured through scan
            // settings. We start with empty scan settings and enable a very generous
            // set of symbologies. In your own apps, only enable the symbologies you
            // actually need.
            var settings            = picker.GetDefaultScanSettings();
            var symbologiesToEnable = new Symbology[] {
                Symbology.Qr,
                Symbology.Ean13,
                Symbology.Upce,
                Symbology.Ean8,
                Symbology.Upca,
                Symbology.Qr,
                Symbology.DataMatrix
            };

            foreach (var sym in symbologiesToEnable)
            {
                settings.EnableSymbology(sym, true);
            }
            await picker.ApplySettingsAsync(settings);

            // This will open the scanner in full-screen mode.
        }
        public ExtendedSamplePage()
        {
            InitializeComponent();
            // must be set before you use the picker for the first time.
            ScanditService.ScanditLicense.AppKey = appKey;
            // retrieve the actual native barcode picker implementation. The concrete implementation
            // will be different depending on the platform the code runs on.
            _picker = ScanditService.BarcodePicker;
            // will get invoked whenever a code has been scanned.
            _picker.DidScan += OnDidScan;

            // set up the settings page
            _settingsPage = new SettingsPage();
        }
예제 #3
0
        public SettingsPage()
        {
            InitializeComponent();

            _picker       = ScanditService.BarcodePicker;
            _scanSettings = _picker.GetDefaultScanSettings();

            initializeGuiElements();

            // restore the currently used settings to those found in
            // the permanent storage.
            updateScanSettings();
            updateScanOverlay();
        }
        private async void InitSettings()
        {
            IBarcodePicker _picker = ScanditService.BarcodePicker;

            // The scanning behavior of the barcode picker is configured through scan
            // settings. We start with empty scan settings and enable a very generous
            // set of symbologies. In your own apps, only enable the symbologies you
            // actually need.
            _scanSettings = _picker.GetDefaultScanSettings();
            var symbologiesToEnable = new Symbology[] {
                Symbology.Qr,
                Symbology.Ean13,
                Symbology.Upce,
                Symbology.Code128,
                Symbology.Ean8,
                Symbology.Upca,
                Symbology.DataMatrix
            };

            foreach (var sym in symbologiesToEnable)
            {
                _scanSettings.EnableSymbology(sym, true);
            }
            await _picker.ApplySettingsAsync(_scanSettings);

            // This will open the scanner in full-screen mode.
            ScanditService.BarcodePicker.CancelButtonText  = "Done";
            ScanditService.BarcodePicker.DidScan          += OnDidScan;
            ScanditService.BarcodePicker.DidStop          += OnDidStopAsync;
            ScanditService.BarcodePicker.AlwaysShowModally = true;
            await UpdateScanSettings();

            UpdateScanOverlay();
            //ScanditService.BarcodePicker.CancelButtonText = "Done";
            await ScanditService.BarcodePicker.StartScanningAsync(false);
        }