Jump to content
Sign in to follow this  
tom13

PixelSearch count?

Recommended Posts

tom13

When I use PixelSearch it returns me the first match, however I need to check all matches in a specific area. Is there any way to add a count (eg. when count is 2 it returns the second match) so I can make a loop?

Share this post


Link to post
Share on other sites
Bowmore

When I use PixelSearch it returns me the first match, however I need to check all matches in a specific area. Is there any way to add a count (eg. when count is 2 it returns the second match) so I can make a loop?

You need to use PixelGetColor in a loop to check every pixel.

The example below will check every pixel within a 50 x 50 square. If you test a large it won't be very fast.

$TestColour = Dec("FF0000")
For $i = 250 To 300
    For $j = 450 To 500
        If $Colour =  PixelGetColor( $i , $j ) Then
            ;Do what you need to do or save the coords to an array
        EndIf
    Next
Next

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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  

×