Jump to content
Sign in to follow this  
Guest Ultima

Is there a way to find a BMP picture on the screen

Recommended Posts

Guest Ultima

Sometimes locating a pixel coordinates and color isn't good enough. I wonder if there is a way to find a specific BMP picture on the current screen. And maybe able to specify the accuracy of it? hmm, vary from 100% match to, say, 50% match?

Share this post


Link to post
Share on other sites
Guest Ultima

I'm thinking to have this xxx.bmp picture put in the same folder as the script. Then let the script to find a match of that picture on the computer screen. I haven't found a way to do this but have seen this function on another software. Wonder if there is a way to do it in AutoIt.

Share this post


Link to post
Share on other sites
Lazycat

Just an idea (not tried): open your picture in the GUI, get it checksum by PixelChecksum. Then get the same size region checksum from screen and compare with previous calculated checksum. Of course, this will be very time consuming... but if your picture is small and you approximately know where it should be located, this may be real. Also probably you can additioanlly get checksum of first line of picture and compare it, and when match will be found, compare checksum of whole image to be sure that image is match.

Share this post


Link to post
Share on other sites
Lee Evans

I am trying to do something similar.

I was using the pixelfunc.au3 posted bu Konan--M to give me the checksums of areas of the screen that I wanted to examine. These areas contain images that are drawn from a list of mathmatical parameters.

Using the captdll from Lazycat I was then able to capture the same region of the screen. I was then hoping to display the images to the user so that they could decide if the differences were acceptable or not.

But the problem is that some of the differences are not very obvious to the naked eye so I was looking for a way to highlight them to the user.

File comparing the captured bit maps is not really usefull as there is obviously no real clue of what the differences are.

I did look at non3's original pixelfunc.au3 where instead of a pixelchecksum they wrote out a whole file of the pixel colours. This is then easier to see the difference from comparing the text files. You could possibly then reconstruct the picture but changing the colour of the different pixels to highlight where one file differs from the other.

I found a post from erifash for a couple of scripts one to read an area of screen pixel colours into a hex file and another to reconstruct the file (Pixel copy x1,y1,x2,y2). Again though this seems slow.

If anyone has any further thoughts could they share them . I know that there are commercial software tools out there to do this but I really would like to do this in AutoIt or at a push use a freeware tool.

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.