Jump to content
Sign in to follow this  

Custom PixelSearch

Recommended Posts


I have built this function to search the screen for a red shade pixel inside the area of an ellipse. The problems I'm having is that obviously if I search every single pair of coordinates it is too time consuming. The other problem is that if I skip too many pixels then it won't find the hot spot coordinates. Any suggestions?

Func ScreenSearch( ByRef $Hot_Coords )

      Local $Angle
      Local Const $a = 1024
      Local Const $b = 768
      Local $Ellipse_eq

         For $x = 0 To 1023 Step 6
            For $y = 0 To 767 Step 4
           $Ellipse_eq = ($x/$a) ^2 + ($y/$b) ^2
            If $Ellipse_eq < 1 Or $Ellipse_eq = 1 Then                           

                If PixelGetColor($x, $y) = 0xBD0000 Then   
                             $Hot_Coords[0] = $x
                             $Hot_Coords[1] = $y                      



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.