问题
I'm trying with the code below but without success.
Here is how the code shoud works:
1-Download the image
2-Show the image
3-Do the search with ImageSearch method.
I tried following the procedure from this post but without success too: https://autohotkey.com/board/topic/78242-imagesearch-not-working/
My AHK version is: 1.1.30.01 64-bit
We can get it from the command: MsgBox % A_AhkVersion " " (A_PtrSize=8 ? "64-bit" : "32-bit")
URLDownloadToFile,https://www.autohotkey.com/assets/images/ahk-logo-no-text241x78-180.png,ahk-logo-no-text241x78-180.png
Gui,Add,Picture,,ahk-logo-no-text241x78-180.png
Gui,Show
^e:: ;(Ctrl+e)
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, ahk-logo-no-text241x78-180.png
if (ErrorLevel == 0)
{
MsgBox, Found!
}
else
{
MsgBox, ErrorLevel:%ErrorLevel%
}
return
回答1:
That logo is a PNG with transparency. If you use an image without transparency it will probably work. (Small enough to fit the screen and without shrinking or enlarging.)
There are details in the documentation about a transparency setting, but it's not likely to work with PNG so easily anyway. Because behind PNG's opacity channel there can be any color hidden.
来源:https://stackoverflow.com/questions/53986793/imagesearch-from-autohotkey-never-works-in-my-pc