SaraMclaren

How to search for given sub-image?

4 posts in this topic

Hi, I've been searching various API of autoit and GDI and I'm still confused.   I'm trying to use autoit to run some tests.   I'd like to search the screen for a given known image (eg: a button with specific size/text).     We take screen shots during a  known good state, and want to make sure these sections are visible when the script is run.  

I was thinking something to the line of:

1. take screenshot

2. open "button_special.png"

3. Scan screenshot for button_special.png existenace:

      a. Loop through all pixels in button_special.png
      b. find matching pattern in screenshot


I guess I'm stuck on the basics of reading pixels out of button_special.png.   Is there a clean way to do this?     Could someone provide sample code to help me get started?

Thanks!

Sara
 

Share this post


Link to post
Share on other sites



The best way to getting started is to read the help to understand the basics. After understood this you should also read the UDF-Part of the help, specialy GDIPlus Reference. And you should read about fileformat of png, for example: https://en.wikipedia.org/wiki/Portable_Network_Graphics

Share this post


Link to post
Share on other sites

Just saw images each thread.  Thanks john!  I wished it hadn't relied on compiled dll though.  

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now