Help Using ImageSearchArea!!

11/19/2019 00:01 edmer#1
Hii, Can help me make this code work?
I'm trying to find one image in a certain range, but I can't get it to detect it

I use this code to capture the position

Code:
_ImageSearch('Res/Ok1.png',1,$Sx,$Sy,10)
Ok here all ok the position of the imagen Ok is save in Sx,Sy

using this another code i move the mouse in the specific range whats i want

Code:
MouseClick("left",$Sx+60,$Sy-164)
here one pict of the example
[Only registered and activated users can see links. Click Here To Register...]
the black box is the area that is supposed to detect, since the mouse moves just to the upper right corner

now i want in this range detect the icon of the star using imageSearchArea

Code:
_ImageSearchArea('Res/Star.png',1,$Sx,$Sy,$Sx+60,$Sy-164,$x,$y,10)
here is the problem... i not found the imagen :S whats is wrong?

using this i can capture the image
Code:
_ImageSearch('Res/Star.png',1,$x,$y,10)

but I need to detect this range, since this window is open several times, and I need to detect "the star" in the specific window of the "Ok" event
11/19/2019 01:59 elmarcia#2
Quote:
Originally Posted by edmer View Post

Search area is a rectangle from top left to right bottom, you first search for your button position, but your search area is wrong u should use

Code:
_ImageSearchArea('Res/Star.png',1,$Sx,$Sy-164,$Sx+60,$Sy,$x,$y,10)
11/19/2019 02:11 edmer#3
Quote:
Originally Posted by elmarcia View Post
Search area is a rectangle from top left to right bottom, you first search for your button position, but your search area is wrong u should use

Code:
_ImageSearchArea('Res/Star.png',1,$Sx,$Sy-164,$Sx+60,$Sy,$x,$y,10)
Is working XD i do not understand how but is working XD hahaha tyy !!
11/19/2019 15:07 elmarcia#4
Quote:
Originally Posted by edmer View Post
Is working XD i do not understand how but is working XD hahaha tyy !!
Here is a detailed explanation of why its working, i don't know if that would help u understand, but anyway, coord system is xo,yo,x1,y1, where xo,yo are left and top coordinates and x1,y1 are right and bottom

[Only registered and activated users can see links. Click Here To Register...]

Note that (sx+60,sy - 164) is right coordinate but not bottom
11/21/2019 16:48 edmer#5
Oh men, ty !! perfectly understood thank you very much :) !! If you made this material just to explain this excellent, thank you very much for the explanation!

I have anothers doubts, since I would like to speed up my script a little more, so many images to look for ends up slowing the script a bit, I don't know if to put the image to look complete or just a piece of it, if this affects or not, or if it is better to use pixelsearch or some other function ... should I create a new thread?