Louis Tran
Louis Tran

Reputation: 1156

How to tell a selected area on screen contains text?

Suppose I have the coordinates of 2 corner points of a selected area on screen. Is it possible to tell if the area contains text or blank. If text exists, can it be converted to a string?

** The selected area has a solid background (1 color).

Upvotes: 1

Views: 139

Answers (1)

Alastair Brown
Alastair Brown

Reputation: 1616

I think there are three steps in answering your question:

  1. The first step in answering you question is contained in Capture the Screen into a Bitmap.

  2. To determine if the screen is blank you can sample each pixel using Bitmap.GetPixel, and if all the pixels are the same color as the first then it's blank.

  3. To determine what the text is you'll need some OCR, and the answer to that question is answered in Where can i find a free .Net (C#) library that i can use to scan and OCR documents?.

Upvotes: 3

Related Questions