Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scan Image and SetRect Problem
#1
When I try to use scan and provide a SetRect for it, I get an invalid argument. Could you guys please help me with properly making scan use SetRect? I'm confused on how to set the dimensions of the rectangle, which defines the search region. What I tried to do what locate the image in client area, then take the mouse coordinates and put them into the code. Would appreciate it, thank you.

Function doSomething
Code:
Copy      Help
int wndBS=win("Shabalabadingdong")

act wndBS

RECT a;
SetRect &a 749 749 174 174
if (scan("image:h7CB84AFB" wndBS a 16))
,out "The image was found!"
,ret
,
else out "The image was not found!"
ret
,
#2
RECT is left top right bottom. Not left top width height. In your code, right is less than left.
SetRect &a 749 749 749+174 749+174
#3
So I'm only selecting the top left corner, and the bottom right corner? That makes sense but why were there 6 arguments in SetRect?

Can you give me an example like SetRect &a; topleftX; bottomrightX

I'm not sure if it's the X/Y values of the mouse or which/how many numbers your supposed to put in because I couldn't find SetRect in the manual.
#4
SetRect &a L T R B

is the same as

a.left=L; a.top=T; a.right=R; a.bottom=B

right must be > left. bottom must be > top.
#5
Okay thanks, that helps. But I'm not sure if I'm putting the right values. Am I supposed to fill in the X of my mouse when I'm drawing a rectangle?
#6
left and top belong to the rectangle. right and bottom don't.
For example, this sets 1x1 pixel rectangle at 30x40:
SetRect &a 30 40 31 41


Forum Jump:


Users browsing this thread: 1 Guest(s)