Posts: 15
Threads: 10
Joined: Jan 2015
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
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
,
Posts: 12,140
Threads: 142
Joined: Dec 2002
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
Posts: 15
Threads: 10
Joined: Jan 2015
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.
Posts: 12,140
Threads: 142
Joined: Dec 2002
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.
Posts: 15
Threads: 10
Joined: Jan 2015
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?
Posts: 12,140
Threads: 142
Joined: Dec 2002
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