In AHK V1, I found Gdip_ImageSearch, it distributed image search to me by hwnd.
It is also covered by the background and put on several related matches.
Code: Select all
#Include Gdip_All.ahk
#Include Gdip_ImageSearch.ahk
CoordMode Pixel, Screen
Token := Gdip_Startup()
WinGet, hwnd, ID, A
bmpHaystack := Gdip_BitmapFromHWND(hwnd)
bmpNeedle := Gdip_CreateBitmapFromFile("image.png")
RET := Gdip_ImageSearch(bmpHaystack,bmpNeedle, outputVar,0,0,0,0,0,0xFF0000,1,90)
Gdip_DisposeImage(bmpHaystack)
Gdip_DisposeImage(bmpNeedle)
There is only one problem with ImagePut:
I don't understand how can I find multiple identical matches in a window?
Here is what I have at the moment:
Code: Select all
#Include ImagePut.ahk2
#Include Gdip_All.ahk2
ImagePut.gdiplusStartup()
hwnd := WinGetID("A")
Numpad0::
{
pBitmap := Gdip_BitmapFromHWND(hwnd)
pic := ImagePutBuffer(pBitmap)
xy := pic.ImageSearch("file.png")
if xy
MouseMove xy[1]-8, xy[2]-16
}