OcrControl.Completed Event

 

Deprecated. The Completed Event is raised by the CaptureFrame() Method when The Bing Optical Character Recognition (OCR) Control receives a response from the Bing OCR Service. The service response is stored in the OcrCompletedEventArgs object associated with this event.

Published date: March 4, 2014

Warning

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

Syntax

public event EventHandler<OcrCompletedEventArgs> Completed

Remarks

Use this event to intercept the text and image data returned by the OCR Service.

Example

The following event handler writes the text and rotation of the captured image to a TextBlock named tbResults.

private void OCR_Completed(object sender, OcrCompletedEventArgs e)
{
    // Make sure there is text.
    if (e.Result.Lines.Count == 0)
    {
        tbResults.Text = "No text found.";
        return;
    }

    // Read the text and print it to a TextBlock.
    var sb = new System.Text.StringBuilder();
    foreach (Line l in e.Result.Lines)
    {
        foreach (Word w in l.Words)
        {
            sb.AppendFormat("{0} ", w.Value);
        }
        sb.AppendLine();
    }
    tbResults.Text = sb.ToString();
}

Requirements

Minimum Supported Client

Windows 8.1

Required Extensions

Bing OCR

Namespace

Bing.Ocr