ImageSearch with png files Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Adanlink
Posts: 5
Joined: 15 Aug 2017, 13:34

ImageSearch with png files

23 Aug 2017, 12:22

Hi another again, today I have tried to detect a "sentence" in a background what have random colors that changes in real time. So I wanted to detect the sentence with ImageSearch like this:

Code: Select all

F1::
ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, Pizza.png
If(ErrorLevel == 0){
Click, %foundX%, %foundY%
}else{
MsgBox, Image not found.
}
return
But it only detects it when I put the image in a black background. The PNG have only the sentence, the background is totally transparent.
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: ImageSearch with png files  Topic is solved

23 Aug 2017, 12:26

Make the .png search image with a black background and then use:

Code: Select all

F1::
ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *TransBlack Pizza.png
If(ErrorLevel == 0){
Click, %foundX%, %foundY%
}else{
MsgBox, Image not found.
}
return
Adanlink
Posts: 5
Joined: 15 Aug 2017, 13:34

Re: ImageSearch with png files

23 Aug 2017, 13:30

Thank you very much Xtra! Now I can continue with my script! I cannot summon a beer but if I could I would summon one for you XD.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CrowexBR, Google [Bot], gsxr1300, ht55cd3 and 281 guests