Link to home
Start Free TrialLog in
Avatar of yc
yc

asked on

How to capture the word displayed on screen?

I want my application can capture the word displayed on the screen.

I know if the word is in picture, i could not capture it.

But if it is displayed through fonts files, how can i capture it after the mouse pointer stay on it a second?
Avatar of Motaz
Motaz

That is a deffecult task..

Motaz
That is a deffecult task..

Motaz
Avatar of yc

ASKER

Hi, Motaz

Just as you said! I think the question is very difficult.

I will add the point for it every day! :)

I think i can do some translating between two language through the function.


Regards

Ye Chen
What did you want to do exactly yc ?

Why did you want to capture text in a bitmap ??

Motaz
Avatar of yc

ASKER

Hi, Motaz

I do not want to capture the words in a image.

I only want to capture the word print to screen.

The following is my thinking:

1.) Modify the displaying function in API such as TextOut...
When the mouse position is in the area of which the word's position printing to screen, transmit the word to my application.

1.) Set a timer:
It will active a second or less than a second.
when it works, it can recording the mouse postion and compare with the last time. If the position is same than do 2.)

2.) Force to refresh the displaying the mouse position. The result is 0.) will capture the word on mouse position.

How do you think?

Regards

Ye Chen




Avatar of yc

ASKER

Hi, Motaz

I do not want to capture the words in a image.

I only want to capture the word print to screen.

The following is my thinking:

1.) Modify the displaying function in API such as TextOut...
When the mouse position is in the area of which the word's position printing to screen, transmit the word to my application.

1.) Set a timer:
It will active a second or less than a second.
when it works, it can recording the mouse postion and compare with the last time. If the position is same than do 2.)

2.) Force to refresh the displaying the mouse position. The result is 0.) will capture the word on mouse position.

How do you think?

Regards

Ye Chen




ASKER CERTIFIED SOLUTION
Avatar of belgianbasman
belgianbasman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yc

ASKER

Hi, belgianbasman

Thanks your helping.

But how can replace the API's text output function.
Now i known TEXTOUT is function need to replace, i wand to know
if there is other function need to modify?

Regards
Ye Chen
You don't have to replace TextOut, just do some other stuff around the calling of TextOut, like the record keeping.

I'll paste in a fragment of the code from my proposed answer, and indicate the line you have to replace with a textout with ##**

CurrentDrawnText:=new(DrawnText);
if FirstDrawnText=nil then
  begin
      FirstDrawnText:=CurrentDrawnText
  end
else
  begin
      CurrentDrawnText^.Next:=FirstDrawnText;
      FirstDrawnText:=CurrentDrawnText;
  end;
CurrentDrawnText^.Next:=nil;
CurrentDrawnText^.Top:=  <top value of the point where the string has to be drawn>
CurrentDrawnText^.Left:=  <left value of the point where the string has to be drawn>
CurrentDrawnText^.Text:=  <the string that has to be drawn>
##** .. <draw the string to the canvas the way you are used to, with TextOut>  ##**

That should do the trick.

Avatar of yc

ASKER

Hi, belgianbasman

Does your code can capture the text printing to screen by other application?

I want capture the word not only print by my program, but also by the other application and the 95/98/nt system.

Regards

Ye Chen
Avatar of yc

ASKER

Adjusted points to 55