Screenshot to Text OCR C#

A screenshot can include text, image, drawings etc. where you might need to extract written information. In such scenarios, you can convert the screenshot to text in order to retrieve the text information. For example, there may be different incoming screenshots as the proof of payment to a company and the text information about the amount required to be extracted. In accordance with such requirements, this article covers how to convert a screenshot to text with OCR in C#.

Screenshot to Text with OCR – C# API Installation

Aspose.OCR for .NET API can be used to perform optical recognition operations over an image. Screenshots are basically the images of screen contents so you can process such images to extract some information. Simply access the API by downloading the DLL reference file from the New Releases page or using the NuGet installation command below:

PM> Install-Package Aspose.OCR

Convert Screenshot to Text with OCR in C#

You can convert a screenshot to text with OCR in C# with the following steps:

  1. Create an object of AsposeOcr class.
  2. Convert a screenshot to text using the RecognizeImage method.
  3. Display the recognized text.

The following sample code demonstrates how to convert a screenshot to text in C#:

Convert Screenshot from URL to Text with OCR in C#

In some cases, the screenshots are shared via URL links of DropBox, Imgur, etc. The API enables you to utilize the URL link instead of downloading and then processing such screenshots. The steps below explain how to convert a screenshot from URL to Text with OCR in C#:

  1. Get a screenshot from URL for OCR operations.
  2. Create an instance of AsposeOcr class.
  3. Recognize the text from the screenshot with OCR.
  4. Print the recognized text from the URL.

The code snippet below explains how to convert a screenshot from URL to text with OCR in C#:

Get a Free Evaluation License

You may request a Free Temporary License to evaluate the API in its full capacity.

Conclusion

In this article, you have learned how to convert a screenshot to text with OCR in C#. This way you can extract a lot of useful information based on your requirements. Furthermore, you may write to us at the forum in case you have any concerns.

See Also