ImageSearch from AutoHotKey never works in my PC

穿精又带淫゛_ 提交于 2019-12-11 09:53:30

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!