示例#1
0
        protected override MobileBarcodeScanner GetInstance()
        {
            var scanner = new MobileBarcodeScanner(this.getTopActivity());

            if (BarCodes.CustomOverlayFactory != null)
            {
                var overlay = BarCodes.CustomOverlayFactory();
                if (overlay != null)
                {
                    scanner.UseCustomOverlay = true;
                    scanner.CustomOverlay    = overlay;
                }
            }
            return(scanner);
        }
示例#2
0
        protected override MobileBarcodeScanner GetInstance()
        {
            var scanner = new MobileBarcodeScanner(Deployment.Current.Dispatcher);

            if (BarCodes.CustomOverlayFactory != null)
            {
                var overlay = BarCodes.CustomOverlayFactory();
                if (overlay != null)
                {
                    scanner.UseCustomOverlay = true;
                    scanner.CustomOverlay    = overlay;
                }
            }
            return(scanner);
        }
示例#3
0
        //public void CheckScannerAvailability() {
        //    var frontCamera = UIImagePickerController.IsCameraDeviceAvailable(UIImagePickerControllerCameraDevice.Front);
        //    var rearCamera = UIImagePickerController.IsCameraDeviceAvailable(UIImagePickerControllerCameraDevice.Rear);
        //    if (!frontCamera && !rearCamera)
        //        throw;

        //    return await AVCaptureDevice.RequestAccessForMediaTypeAsync(AVMediaType.Video);
        //}


        protected override MobileBarcodeScanner GetInstance()
        {
            var controller = this.GetTopViewController();
            var scanner    = new MobileBarcodeScanner(controller);

            if (BarCodes.CustomOverlayFactory != null)
            {
                var overlay = BarCodes.CustomOverlayFactory();
                if (overlay != null)
                {
                    scanner.UseCustomOverlay = true;
                    scanner.CustomOverlay    = overlay;
                }
            }
            return(scanner);
        }