Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drop Box for OCR
#1
Hi,

I am using the OCR functionality to get some text from a certain area of the screen. The onscreen measurements of my analysis program aren't accessible by normal QM methods.


Code:
Copy      Help
CaptureRect5 1 800 250 250



str img="$common documents$\My QM Share\clipboard.bmp" ;;this is an image containing text
run "$common documents$\My QM Share\clipboard.bmp"

typelib MODI {A5EDEDF4-2BBC-45F3-822B-E60C278A1A79} 11.0
MODI.Document doc._create

doc.Create(img.expandpath)
doc.OCR(MODI.miLANG_ENGLISH -1 0)

MODI.Image im=doc.Images.Item(0)
str s=im.Layout.Text

out s ;;and this is the text


I want to direct the user to drop the figures in this small area to CaptureRect. Even just a drawing of a Rectangle on screen to temporarily indicate where the screen grab will occur would be great. Any ideas?

Thanks,
Stuart
#2
Code:
Copy      Help
str box=
;|-----|
;|      |
;|-----|

rep 15
,OnScreenDisplay box 0.1 300 300
,0.2
#3
Another way.

Code:
Copy      Help
RECT r
r.left=300
r.top=300
r.right=300+100
r.bottom=300+100
qm.OnScreenRect 1 &r
2
qm.OnScreenRect 2 &r
#4
Thanks guys,
I didn't know I could use a str collection the way you set up the box str, John,
and didn't know about OnScreenRect.

Amazing help from Gintaras and the community as always!
Thanks,
Stuart
#5
Hi,

I looked through the manual and googled this as well and couldn't seem to find the answer. Any idea on how to change the thickness and color of an OnscreenRect drawn rectangle?

Thanks,
Stuart
#6
Cannot be changed.
#7
I was thinking that something instead could be done with transparency involving parts of a toolbar or Dialog or maybe bunching a few toolbars together into a frame around an empty middle.

What do ya think? Is this an avenue worth pursuing.

Stuart
#8
On-screen drawing


Forum Jump:


Users browsing this thread: 1 Guest(s)