ImageSearch does not return an area that the found image covers. It returns the coordinates of the upper-left corner. You could calculate the lower-right corner if you know the size or use one of the various methods that have been posted on the forum for determining the size of an image. Here is how you would report the location of where it was found both in a MsgBox and by moving the mouse to that location:
Code: Select all
#SingleInstance Force
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
1::
Loop
{
ImageSearch, x, y, 0, 0, 1366, 768, C:\Users\Hernest\Desktop\name images\UtamoBroken.png
if (ErrorLevel = 0)
{
MsgBox, % "image was found at x=" x " y=" y
MouseMove, x, y
break
}
}
return
If you want to search once and report whether it was found or not, like you mentioned in your last post:
Code: Select all
#SingleInstance Force
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
1::
ImageSearch, x, y, 0, 0, 1366, 768, C:\Users\Hernest\Desktop\name images\UtamoBroken.png
if (ErrorLevel = 0)
{
MsgBox, % "image was found at x=" x " y=" y
MouseMove, x, y
}
else
MsgBox, image was not found
return