public void Scan(IOverlaySettings overlaySettings)
        {
            this.overlaySettings = overlaySettings;
            var window = UIApplication.SharedApplication.KeyWindow;
            var vc     = window.RootViewController;

            if (overlaySettings is DocumentCaptureOverlaySettings)
            {
                this.documentCaptureRecognizerWrapper = ((DocumentCaptureOverlaySettings)overlaySettings).DocumentCaptureRecognizerWrapper;
            }
            else
            {
                this.documentCaptureRecognizerWrapper = null;
                this.highResImage = null;
            }
            if (overlaySettings is FieldByFieldOverlaySettings)
            {
                this.fieldByFieldCollection = ((FieldByFieldOverlaySettings)overlaySettings).FieldByFieldCollection;
            }
            else
            {
                this.fieldByFieldCollection = null;
            }

            recognizerRunnerViewController = MBViewControllerFactory.RecognizerRunnerViewControllerWithOverlayViewController(((OverlaySettings)overlaySettings).CreateOverlayViewController(this));

            vc.PresentViewController(ObjCRuntime.Runtime.GetINativeObject <UIViewController>(recognizerRunnerViewController.Handle, false), true, null);
        }
Beispiel #2
0
        public void Scan(IOverlaySettings overlaySettings)
        {
            recognizerBundle = null;
            documentCaptureRecognizerTransferable = null;
            documentCaptureRecognizerWrapper      = null;
            fieldByFieldCollection = null;
            fieldByFieldBundle     = null;

            androidHostActivity.ScanningStarted(this);
            var aOverlaySettings = (OverlaySettings)overlaySettings;

            if (aOverlaySettings is DocumentCaptureOverlaySettings)
            {
                documentCaptureRecognizerTransferable = ((DocumentCaptureUISettings)aOverlaySettings.NativeUISettings).DocumentCaptureRecognizerTransferable;
                documentCaptureRecognizerWrapper      = ((DocumentCaptureOverlaySettings)aOverlaySettings).DocumentCaptureRecognizerWrapper;
                ActivityRunner.StartActivityForResult(androidHostActivity.HostActivity, androidHostActivity.ScanActivityRequestCode, ((OverlaySettings)overlaySettings).NativeUISettings);
                return;
            }
            if (aOverlaySettings is FieldByFieldOverlaySettings)
            {
                var fieldByFieldOverlaySettings = (FieldByFieldOverlaySettings)aOverlaySettings;
                fieldByFieldCollection = fieldByFieldOverlaySettings.FieldByFieldCollection;
                var nativeOverlay = (FieldByFieldUISettings)fieldByFieldOverlaySettings.NativeUISettings;
                fieldByFieldBundle = nativeOverlay.FieldByFieldBundle;

                ActivityRunner.StartActivityForResult(androidHostActivity.HostActivity, androidHostActivity.ScanActivityRequestCode, nativeOverlay);
                return;
            }

            // assume given recognizerCollection was also used for constructing overlaySettings
            recognizerBundle = ((RecognizerCollection)((RecognizerCollectionOverlaySettings)aOverlaySettings).RecognizerCollection).NativeRecognizerBundle;
            ActivityRunner.StartActivityForResult(androidHostActivity.HostActivity, androidHostActivity.ScanActivityRequestCode, ((OverlaySettings)overlaySettings).NativeUISettings);
        }
Beispiel #3
0
 public IDocumentCaptureOverlaySettings CreateDocumentCaptureOverlaySettings(DocumentCaptureRecognizerWrapper documentCaptureRecognizerWrapper)
 {
     return(new DocumentCaptureOverlaySettings(documentCaptureRecognizerWrapper));
 }
Beispiel #4
0
 public DocumentCaptureOverlaySettings(DocumentCaptureRecognizerWrapper documentCaptureRecognizerWrapper)
     : base(new DocumentCaptureUISettings(new DocumentCaptureRecognizerTransferable((Com.Microblink.Entities.Recognizers.Blinkinput.Documentcapture.DocumentCaptureRecognizer)(((Microblink.Forms.Droid.Recognizers.DocumentCaptureRecognizer)documentCaptureRecognizerWrapper.DocumentCaptureRecognizer).NativeRecognizer))))
 {
     DocumentCaptureRecognizerWrapper = documentCaptureRecognizerWrapper;
 }
Beispiel #5
0
 public DocumentCaptureOverlaySettings(DocumentCaptureRecognizerWrapper documentCaptureRecognizerWrapper)
     : base(new MBDocumentCaptureOverlaySettings())
 {
     nativeDocumentCaptureOverlaySettings = NativeOverlaySettings as MBDocumentCaptureOverlaySettings;
     DocumentCaptureRecognizerWrapper     = documentCaptureRecognizerWrapper;
 }