Ejemplo n.º 1
0
 public string ScannerControllerLocalizedTextForDetectionStatus(SBSDKScannerViewController controller, SBSDKDocumentDetectionStatus status)
 {
     // Alternative method to "scannerController:viewForDetectionStatus:"
     // Here you can return just the localized text for the status label depending on the detection status.
     return(null);
 }
Ejemplo n.º 2
0
        public UIView ScannerControllerViewForDetectionStatus(SBSDKScannerViewController controller, SBSDKDocumentDetectionStatus status)
        {
            // Alternative method to "scannerController:localizedTextForDetectionStatus:".
            // Here you can return a custom view that you want to use to visualize the latest detection status.

            var label = new SBSDKDetectionStatusLabel();

            label.BackgroundColor = UIColor.Red;
            label.TextColor       = UIColor.White;

            switch (status)
            {
            case SBSDKDocumentDetectionStatus.Ok:
                label.Text            = "Don't move.\nCapturing...";
                label.BackgroundColor = UIColor.Green;
                break;

            case SBSDKDocumentDetectionStatus.OK_SmallSize:
                label.Text = "Move closer";
                break;

            case SBSDKDocumentDetectionStatus.OK_BadAngles:
                label.Text = "Perspective";
                break;

            case SBSDKDocumentDetectionStatus.Error_NothingDetected:
                label.Text = "No Document";
                break;

            case SBSDKDocumentDetectionStatus.Error_Noise:
                label.Text = "Background too noisy";
                break;

            case SBSDKDocumentDetectionStatus.Error_Brightness:
                label.Text = "Poor light";
                break;

            case SBSDKDocumentDetectionStatus.OK_BadAspectRatio:
                label.Text = "Wrong aspect ratio.\n Rotate your device";
                break;

            default:
                return(null);
            }

            label.SizeToFit();
            return(label);
        }
Ejemplo n.º 3
0
        public UIColor ScannerControllerPolygonColorForDetectionStatus(SBSDKScannerViewController controller, SBSDKDocumentDetectionStatus status)
        {
            // If the detector has found an acceptable polygon we show it with green color
            if (status == SBSDKDocumentDetectionStatus.Ok)
            {
                return(UIColor.Green);
            }

            return(UIColor.Red);
        }
Ejemplo n.º 4
0
 public void ScannerControllerDidDetectPolygonWithStatus(SBSDKScannerViewController controller, SBSDKPolygon polygon, SBSDKDocumentDetectionStatus status)
 {
     // Everytime the document detector finishes detection it calls this delegate method.
 }