Image Search AHK

CoordMode Pixel  ; Interprets the coordinates below as relative to the screen rather than the active window.

ImageSearch, FoundX, FoundY, 10, 10, 1200, 900, *50 C:\1.jpg ; You need to set tolerance, or any slight change in the way your computer displays the image will result in failure, especially with JPEG compression. It is denoted by a star (*) followed by the tolerance.

if ErrorLevel = 2

MsgBox Could not conduct the search.

else if ErrorLevel = 1

MsgBox Icon could not be found on the screen.

else

MsgBox The icon was found at %FoundX%x%FoundY%.

你可能感兴趣的:(Image Search AHK)