Exemple #1
0
        public void OnIdCaptured(IdCapture mode, IdCaptureSession session, IFrameData data)
        {
            CapturedId capturedId = session.NewlyCapturedId;

            // This callback may be executed on an arbitrary thread. We post to switch back
            // to the main thread.
            this.view.Post(() =>
            {
                string message = string.Empty;

                // The recognized fields of the captured Id can vary based on the capturedResultType.
                if (capturedId.CapturedResultType == CapturedResultType.AamvaBarcodeResult)
                {
                    message = GetDescriptionForAamvaBarcodeResult(capturedId);
                }
                else if (capturedId.CapturedResultType == CapturedResultType.VizResult)
                {
                    message = GetDescriptionForViz(capturedId);
                }
                else
                {
                    message = GetDescriptionForCapturedId(capturedId);
                }

                this.ShowAlert(Resource.String.captured_id_title, message);
            });
        }
Exemple #2
0
 public void OnErrorEncountered(IdCapture mode, Throwable error, IdCaptureSession session, IFrameData data)
 {
     // Implement to handle an error encountered during the capture process.
     // This callback may be executed on an arbitrary thread.
     this.view.Post(() =>
     {
         this.ShowAlert(Resource.String.error_title, GetErrorMessage(error));
     });
 }
        private void InitIdCapture()
        {
            // Create a mode responsible for recognizing documents. This mode is automatically added
            // to the passed DataCaptureContext.
            IdCaptureSettings settings = new IdCaptureSettings
            {
                SupportedDocuments = IdDocumentType.IdCardViz | IdDocumentType.DlViz | IdDocumentType.AamvaBarcode
            };

            this.IdCapture = IdCapture.Create(this.DataCaptureContext, settings);
        }
 public void OnErrorEncountered(IdCapture idCapture, NSError error, IdCaptureSession session, IFrameData frameData)
 {
     try
     {
         // Implement to handle an error encountered during the capture process.
         // The error message can be retrieved from the Error localizedDescription.
         this.ShowResult(GetErrorMessage(error));
     }
     finally
     {
         frameData.Dispose();
     }
 }
        public void OnIdCaptured(IdCapture idCapture, IdCaptureSession session, IFrameData frameData)
        {
            try
            {
                CapturedId capturedId = session.NewlyCapturedId;

                string message = string.Empty;

                // The recognized fields of the captured Id can vary based on the capturedResultType.
                if (capturedId.CapturedResultType == CapturedResultType.MrzResult)
                {
                    message = GetDescriptionForMrzResult(capturedId);
                }
                else if (capturedId.CapturedResultType == CapturedResultType.AamvaBarcodeResult)
                {
                    message = GetDescriptionForAamvaBarcodeResult(capturedId);
                }
                else if (capturedId.CapturedResultType == CapturedResultType.VizResult)
                {
                    message = GetDescriptionForViz(capturedId);
                }
                else if (capturedId.CapturedResultType == CapturedResultType.UsUniformedServicesBarcodeResult)
                {
                    message = GetDescriptionForUsUniformedServicesBarcodeResult(capturedId);
                }
                else
                {
                    message = GetDescriptionForCapturedId(capturedId);
                }

                this.ShowResult(message);
            }
            finally
            {
                frameData.Dispose();
            }
        }
Exemple #6
0
 public void OnObservationStopped(IdCapture mode)
 {
     // In this sample we are not interested in this callback.
 }