FindImagePos

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
conjure
Pro Scripter
Posts: 64
Joined: Thu Jan 12, 2012 3:05 pm

FindImagePos

Post by conjure » Fri Jul 21, 2017 8:15 pm

Hi. I want to scan the image i attached and move the mouse at the bottom of the red bar.
I tried

Code: Select all

ScreenCapture>1630,920,1656,1069,%TEMP_DIR%\screenrect2.bmp
FindImagePos>Z:\%ppc%\down.bmp,%TEMP_DIR%\screenrect2.bmp,0,1,XArr,YArr,NumFound
If>NumFound>0
MouseMove>{%XArr_0%+1630},{%YArr_0%+920}
mdl>%YArr_0%
endif
but the mouse goes only on the top of the bar.
Ps. the bar is always different size
(the down.bmp is one red pixel)

Any ideas on how to do it?
Thank you

User avatar
Marcus Tettmar
Site Admin
Posts: 7393
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: FindImagePos

Post by Marcus Tettmar » Mon Jul 24, 2017 9:48 am

Change the return_offset value to 6 (middle bottom). If you want it below the bar, then you can also add a value to the y offset position.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

conjure
Pro Scripter
Posts: 64
Joined: Thu Jan 12, 2012 3:05 pm

Re: FindImagePos

Post by conjure » Tue Jul 25, 2017 11:25 pm

I m sorry Marcus i didn't understand.Can you post an example?

User avatar
Marcus Tettmar
Site Admin
Posts: 7393
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: FindImagePos

Post by Marcus Tettmar » Wed Jul 26, 2017 11:50 am

Please see the help file:
return_offset is used to determine which coordinates should be returned and can be one of the following:

0
Top left position of located image within bitmap_to_scan. In other words X, Y is the top left corner of needle_bitmap within haystack
1
Center: X,Y will be set to the center of the located image within the main haystack image.
2
Top right
3
Bottom left
4
Bottom right
5
Middle top
6
Middle bottom
7
Middle left
8
Middle right
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts