Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ErrorCode Enumeration (Bing.Ocr)

Deprecated. The ErrorCode Enumeration lists the error codes for The Bing Optical Character Recognition (OCR) Control. The error codes are surfaced in the event arguments of the OcrControl.Failed Event.

Published date: March 4, 2014

The Bing OCR Control is deprecated as of March 12, 2014.

public enum ErrorCode

The ErrorCode Enumeration has the following members.


Name Description


Another application is using the camera.


The rear facing camera does not support 1280x720 or 640x480 resolution in photo mode. For more information, see Bing OCR Requirements.


There is no rear-facing camera on this device, or the rear camera is not recognized by the system.


The application does not have permission to access the camera in the current user profile. To prevent this error, open the Package.appmanifest file, and under Capabilities, check Webcam. This causes the application to prompt for camera access when it opens. The user choosing not to allow camera access at startup can also cause this error. The user can correct this by typing

[Windows] + C from your application, clicking Settings, then Permissions, and sliding Webcam to On.


Either the language code is unsupported or there is a problem with the image, depending on the error message returned by the OCR service.


There was an internal error in the OCR Service.


The user’s system was unable to reach the OCR Service.


There is a problem with the application developer’s subscription to the OCR Control.


The attempt succeeded.


The application has reached the maximum number of OCR Service requests allowed by the developer’s monthly subscription to the control.


The ClientID or ClientSecret is expired or invalid.

The following example handles the OcrControl.Failed Event of OcrControlOCR by writing text to TextBlocktbResult, and then either continuing or cancelling preview depending on the error.

<Ocr:OcrControl x:Name="OCR" .../>
<TextBlock x:Name="tbResults" .../>

public MainPage()

    // Assign event handlers
    OCR.FrameCaptured += OCR_FrameCaptured;
    OCR.Completed += OCR_OcrCompleted;
    OCR.Failed += OCR_ErrorOccurred;

private async void OCR_ErrorOccurred(object sender, OcrErrorEventArgs e)
    // Display error message.
    tbResults.Text = e.ErrorMessage;
    // Give guidance on specific errors.
    switch (e.ErrorCode) 
        case ErrorCode.CameraBusy:
            tbResults.Text += "\nClose any other applications that may be using the camera and try again.";
        case ErrorCode.CameraLowQuality:
            tbResults.Text += "\nThe rear facing camera does not meet the resolution requirements of OCR.";
        case ErrorCode.CameraNotAvailable:
            tbResults.Text += "\nA rear facing camera was not found.";
        case ErrorCode.CameraPermissionDenied:
            tbResults.Text += "\nTurn camera permissions on in your application settings.";
        case ErrorCode.InputInvalid:
        case ErrorCode.Unauthorized:
        case ErrorCode.TransactionQuotaReached:
        case ErrorCode.SubscriptionIssue:
        case ErrorCode.InternalError:
            tbResults.Text += "\nNotify your application provider.";

    // Continue or cancel, depending on the error.
    if (e.ErrorCode == ErrorCode.Success) await OCR.StartPreviewAsync();
    else await OCR.ResetAsync();

Minimum Supported Client

Windows 8.1

Required Extensions

Bing OCR



© 2015 Microsoft