Jump to content

Finding a Picture on a screen


Recommended Posts

I was wondering if it was possible to find a pre picture u might have on your screen for example:

Posted Image

If i wanted to find that picture on the screen, is it possible for the program to keep checking the screen until that image comes onto the screen?

Edited by D4rk^S0ul
Link to comment
Share on other sites

  • 4 weeks later...

Due to the fact that the PixelSearch function searches for a color in an area, you could go through searching for a pixel of the same color as the picture's top corner...then everytime that you find that color, you check to see if the pixel next to it is the same as the next pixel in the picture. Due to time constraints, perhaps you might only check alternating pixels or if the picture is big enough, even every five pixels or something.

Rather than searching for the whole picture, you could really pick any pixel of the picture and search for it, and then check if the neighboring pixels match.

"Everything is vague to a degree you do not realize till you have tried to make it precise." - Bertrand Russell [The Philosophy of Logical Atomism]

Link to comment
Share on other sites

Would something simple like this work?:

While 1
    $coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x463D32)
    If Not @error Then
        $Col = PixelGetColor($coord[0] - 14, $coord[1] + 1)
        If $Col = 16776960 Then
            MsgBox(0, "w00t", "w00t")
        EndIf
    EndIf
    Sleep(100)
WEnd

or will it just keep scanning the same spot of colour it finds first?

Edited by D4rk^S0ul
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...