Images Addon的'image.find'命令无法正常工作

时间:2019-09-12 13:53:05

标签: g1ant

我正在使用此代码,该代码应在屏幕上下载并打开图像,然后G1ant软件应搜索图像是否在屏幕上弹出。问题是图像确实弹出了,但是程序输出“在搜索区域中找不到图像”。我该如何解决?

我的代码是-

♥image = ♥environment⟦USERPROFILE⟧\Desktop\image.png

file.download https://jeremykun.files.wordpress.com/2012/01/img49.png filename ♥image

program ♥image

image.find ♥image result ♥point relative false

dialog ♥point

1 个答案:

答案 0 :(得分:2)

您是否等待负责打开图像的程序来加载和显示图像?使用程序命令的wait true自变量,不要将映像名称用作要运行的应用程序,而是执行类似以下操作:

♥imagePath = ‴♥environment⟦USERPROFILE⟧\Documents\some image.png‴

program ‴C:\Program Files\paint.net\paintdotnet.exe‴ arguments "♥imagePath" wait true

image.find ♥imagePath result ♥point relative false

dialog ♥point

此外,您的图片不会按比例缩放吗?