一、下載ImagePut插件
下載地址:GitHub - iseahound/ImagePut: A core library for images in AutoHotkey. Supports AutoHotkey v1 and v2.
二、將插件和要搜索的圖片導入項目
#Include ./plugin/ImagePut.ahk
; 截取當前屏幕
pic := ImagePutBuffer('0')
point := pic.ImageSearch('./image/image.png')
if (IsObject(point)) { ; 判斷是否為數組(即搜索成功)MsgBox('x' point[1] ' y' point[2])
} else {MsgBox('未找到圖像,返回值:' point)
}