OcrEngine Class


Provides optical character recognition (OCR) functionality.

public ref class OcrEngine sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class OcrEngine final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class OcrEngine
Public NotInheritable Class OcrEngine
Object Platform::Object IInspectable OcrEngine

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)


To use the OCR capabilities of the OcrEngine class in your app, call the RecognizeAsync method. When you call the RecognizeAsync method of the OcrEngine class, the method returns an OcrResult object, which contains the recognized text and its size and position. The result is split into lines, and the lines are split into words.

  • The OcrResult contains a collection of OcrLine objects, which you access through the Lines property of the OcrResult.
  • Each OcrLine object contains a collection of OcrWord objects, which you access through the Words property of each OcrLine.
  • Each OcrWord object specifies the text, size, and position information of the word in the image.



Returns a collection of all available OCR languages on the device.


Gets the maximum image pixel dimensions supported by the OCR engine.


Gets the language being used for text recognition.



Returns true if a specified language can be resolved to any of the available OCR languages. See language matching for a further explanation of language resolving.


Scans the specified image for text in the language specified by the RecognizerLanguage property.


Creates a new instance of the OcrEngine class.


Creates a new instance of the OcrEngine class.

Applies to