问题
I am using this code which is supposed to download and open an image on my screen and then the G1ant software is supposed to search if the image popped up on my screen or not. Problem is the image did pop up but the program outputs 'The image was not found in the search area'. How can I fix this?
My code is-
♥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:
Did you wait for the program that is responsible to open your image to load and display the image? Use wait true
argument of program command and do not use the image name as the application to run, rather do something similar to this:
♥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
Also, isn't your image opened scaled?
来源:https://stackoverflow.com/questions/57908266/the-image-find-command-of-images-addon-is-not-working-properly