Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
Dj Telo
- Junior Coder
- Posts: 24
- Joined: Sun Mar 21, 2010 7:27 pm
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.

-
Marcus Tettmar
- Site Admin
- Posts: 7395
- 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.