Problem with FindImagePos
Moderators: JRL, Dorian (MJT support)
Problem with FindImagePos
Hi,
I have a script which runs fine on one laptop, but not working on another laptop. I have digged down the problem to display size. The function FindImagePos is returning wrong coordinates. But what is wrong?
I have tried to attach a little video showing my problem, but the file seems too big (86 MB). Is there way to send it to you? The video is showing a script created an run on the failing laptop (Samsung Ativ 9plus running windows 8.1). I'm running the latest macro scheduler (evaluation copy). As seen in the video the moment I use the "Image recognition wizard" in Macro Scheduler the display size suddenly changes and the icons are bigger and repositioned. I believe this to be the problem. As seen in the end of the video the coordinates of the captured icon on the original desktop reported by the macro scheduler itself is different than the ones in FindImagePos.
Macro Scheduler is reporting 115,128
FindImagePos is reporting 171,192
I have no special display application or anything running. It is pure Windows land we seems to be operating in.
Any Idears?
I have read some posts in this forum with similar issues, but without any solution.
Regards
Michael
I have a script which runs fine on one laptop, but not working on another laptop. I have digged down the problem to display size. The function FindImagePos is returning wrong coordinates. But what is wrong?
I have tried to attach a little video showing my problem, but the file seems too big (86 MB). Is there way to send it to you? The video is showing a script created an run on the failing laptop (Samsung Ativ 9plus running windows 8.1). I'm running the latest macro scheduler (evaluation copy). As seen in the video the moment I use the "Image recognition wizard" in Macro Scheduler the display size suddenly changes and the icons are bigger and repositioned. I believe this to be the problem. As seen in the end of the video the coordinates of the captured icon on the original desktop reported by the macro scheduler itself is different than the ones in FindImagePos.
Macro Scheduler is reporting 115,128
FindImagePos is reporting 171,192
I have no special display application or anything running. It is pure Windows land we seems to be operating in.
Any Idears?
I have read some posts in this forum with similar issues, but without any solution.
Regards
Michael
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Problem with FindImagePos
Is your display zoomed? There's a known issue if Windows is set to zoom objects at certain levels.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Problem with FindImagePos
Hi Marcus,
Thanks for reply. It sounds like the right direction. Sorry to ask this, but how do I find out if it is zoomed?
You are not interested in seeing my video?
(maybe it can clarify things)
Regards
Michael
Thanks for reply. It sounds like the right direction. Sorry to ask this, but how do I find out if it is zoomed?
You are not interested in seeing my video?

(maybe it can clarify things)
Regards
Michael
Re: Problem with FindImagePos
Hi,
I digged into it, and it seems my problem was that on the laptop which was not working the Text size setting was set to 150% as teh DEFAULT setting (!) (See attached screenshot). If I changed that to 100% FindImagePos worked.
But then it brings out another issue, which is my display icons are very small. It is not possible for the MacroScheduler to work on all windows settings conditions?
Regards
Michael
I digged into it, and it seems my problem was that on the laptop which was not working the Text size setting was set to 150% as teh DEFAULT setting (!) (See attached screenshot). If I changed that to 100% FindImagePos worked.
But then it brings out another issue, which is my display icons are very small. It is not possible for the MacroScheduler to work on all windows settings conditions?
Regards
Michael
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Problem with FindImagePos
We are aware that 150% zoom causes issues for FindImagePos. At this stage we do not have a fix. Sorry.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Grovkillen
- Automation Wizard
- Posts: 1132
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Problem with FindImagePos
I don't know if this is a doable work(around) but as I see it the reported find location is indeed correct but it doesn't take the DPI into the equation.
In order to know the zoom level just fetch the reg key for it and divide the result with 96 (default DPI is 96, thus 100%).
In order to know the zoom level just fetch the reg key for it and divide the result with 96 (default DPI is 96, thus 100%).
Code: Select all
RegistryReadKey>HKEY_CURRENT_USER,Control Panel\Desktop,LogPixels,CURRENT_DPI
Let>ZOOM_LEVEL={%CURRENT_DPI%/96*100}
MessageModal>Zoom level: %ZOOM_LEVEL% %
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Problem with FindImagePos
Just to let you know that this issue (image recognition when windows zoom level is set higher than 100%) is now fixed in development and will be in the next maintenance release.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Grovkillen
- Automation Wizard
- Posts: 1132
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Problem with FindImagePos
Great to hear that my idea got you going in the right direction on getting a fix! 

- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Problem with FindImagePos
Version 14.2.04 is now available with this fix.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Grovkillen
- Automation Wizard
- Posts: 1132
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Problem with FindImagePos
I have come to realize that the DPI / PixelsPerInch is causing problems with the current implementation of dialog creation. I develop on my main machine which is on 144DPI but then the dialog looks really messed up on 96DPI machines. I need to then take into account the DPI and create dynamic dialogs instead. Is there a way of getting the DPI as a system variable just like with USER_NAME and COMPUTER_NAME etc.? Or even better let the dialog handle the DPI automatically?
Today I use this to find DPI on both Win8 and Win10:
Today I use this to find DPI on both Win8 and Win10:
Code: Select all
RegistryReadKey>HKEY_CURRENT_USER,Control Panel\Desktop,LogPixels,CURRENT_DPI
If>CURRENT_DPI=
RegistryReadKey>HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI,LogPixels,CURRENT_DPI
Endif>
MDL>CURRENT_DPI