FindImagePos with multiple images found.

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Dj Telo
Junior Coder
Posts: 24
Joined: Sun Mar 21, 2010 7:27 pm

FindImagePos with multiple images found.

Post by Dj Telo » Wed Mar 31, 2010 3:46 pm

Hello!

I want to create a script to click on an image that appears on a web site. The problem is that this image appears several times in that web site and it doesn't link always to the same place.

I'd want to select one of them and I don't know how to do it. Is there any way to define a rectangle or any other screen area in which to find the image with FindImagePos?

Thank you. ;)

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

Post by Marcus Tettmar » Wed Mar 31, 2010 4:07 pm

Yes, FindImagePos can be passed a bitmap. So capture a bitmap from the screen using ScreenCapture. Capture just the rectangle you are looking in and pass this to FindImagePos. Remember to add the returned coordinates to the upper left offset of the search area to translate back to screen coords.
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