Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance, Force
- #NoEnv
- SetBatchLines, -1
- Process, Priority,, High
- #Include, Gdip_All.ahk
- #Include, Gdip_ImageSearch.ahk
- F1::
- vPathN = snicker.png
- vScreen1 := 0
- vScreen2 := 0
- vScreen3 := A_ScreenWidth
- vScreen4 := A_ScreenHeight
- vScreen := vScreen1 "|" vScreen2 "|" vScreen3 "|" vScreen4
- vPos1 := 0, vPos2 := 0, vPos3 := vScreen3, vPos4 := vScreen4
- pToken := Gdip_Startup()
- pBitmapH := Gdip_BitmapFromScreen(vScreen, 0x40CC0020)
- Gdip_SaveBitmapToFile(pBitmapH, "Image.png")
- pBitmapN := Gdip_CreateBitmapFromFile(vPathN)
- vRet := Gdip_ImageSearch(pBitmapH, pBitmapN, vPosXY, vPos1, vPos2, vPos3, vPos4)
- vPos := InStr(vPosXY, ",")
- vPosX := SubStr(vPosXY, 1, vPos-1)
- vPosY := SubStr(vPosXY, vPos+1)
- MsgBox % vRet " (" vPosXY ")"
- ;MsgBox % vPosX " " vPosY
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement