Is there any reason why ImageSearch might not work on one particular monitor but it will work on another when the AHK script is exactly the same?
I took a screenshot on PC 1 of a small area of the screen and put it into a PNG file. ImageSearch finds it on PC 1 monitor no problem.
I took a screenshot on PC 2 of the same area of the screen and put it into a PNG file. ImageSearch does NOT find it on this second PC & monitor and returns Error 1, even when the coordinates are set to 0, 0, A_ScreenWidth, A_ScreenHeight
Image Search not working on 1 monitor
Image Search not working on 1 monitor
Last edited by arathra on 30 Apr 2021, 08:07, edited 1 time in total.
Re: Image Search not working on 1 monitor
Would double-check the file path and coordinates that you are using. Try cropping to a smaller area of the image. I am assuming that the display (monitor) in the test & the capture was the same. If you are not changing the CoordMode, then the target window would typically need to be active, unless you have adjusted the coordinates accordingly. If it does not work, then try a new, small, plain image with no transparency. Capture, display, & test. Post your script for feedback about it. Test on your native or first display.
Re: Image Search not working on 1 monitor
The key difference is different PCs, not different monitors, other than the possibility that having a different (higher-res) monitor has led you to use a different Windows scaling setting. Do you perhaps have a difference in scaling factors between the two PCs, such as 100% on one and 150% on the other?
Also, if your captured screen area contains text, especially antialiased text, then that could be rendered differently on the two machines.
Also, if your captured screen area contains text, especially antialiased text, then that could be rendered differently on the two machines.
Re: Image Search not working on 1 monitor
Thank you for your replies and suggestions.
It took a long time and a lot of fiddling but I did get it to work in the end. And I'm a bit embarrassed to say it mainly my fault - an errant bit of code changed the settings on one PC
Ho hum...
It took a long time and a lot of fiddling but I did get it to work in the end. And I'm a bit embarrassed to say it mainly my fault - an errant bit of code changed the settings on one PC
Code: Select all
if ( PC identifier == XYZ )
change viewport settings
Who is online
Users browsing this forum: mstrauss2021, Spawnova, zephyrus2706 and 352 guests