Jump to content

PixelSearch Continue


Recommended Posts

Hello, basically.. I want PixelSearch to continue where it left off after it got it's first match so I can continue to find more matches. Is this possible? If so, how?

PixelSearch() returns X/Y coordinates. Do the math on the remaining portion of the rectangle and finish the search. You could also search one vertical or horizontal line at a time in a For/Next loop, and then just ContinueLoop.

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Just taking a quick stab at this since I have nothing better to do :D

Func _PixelSearchContinue($left, $top, $right, $bottom, $color, $x = -1, $y = -1, $shadevar = -1, $step = -1, $hwnd = -1)
    Local $ret
    If $y = -1 Then $y = $top
    If $x = -1 Then
        $x = $left
    Else
        $x += 1
        If $x > $right Then
            $x = $left
            $y += 1
            If $y > $bottom Then Return SetError(1, 0, 0)
        EndIf
    EndIf
    If $x = $left Then
        $ret = PixelSearch($x, $y, $right, $bottom, $color, $shadevar, $step, $hwnd)
        If @error = 1 Then Return SetError(1, 0, 0)
        Return SetError(0, 0, $ret)
    Else
        $ret = PixelSearch($x, $y, $right, $y, $color, $shadevar, $step, $hwnd)
        If @error <> 1 Then Return SetError(0, 0, $ret)
        $y += 1
        If $y > $bottom Then Return SetError(1, 0, 0)
        $x = $left
        $ret = PixelSearch($x, $y, $right, $bottom, $color, $shadevar, $step, $hwnd)
        If @error = 1 Then Return SetError(1, 0, 0)
        Return SetError(0, 0, $ret)
    EndIf
EndFuncoÝ÷ ÙKç±jjey«­¢+Ù±½°ÀÌØí±ÍÑàô´Ä°ÀÌØí±ÍÑäô´Ä°ÀÌØíÁÍ()]¡¥±QÉÕ($ÀÌØíÁÍô}A¥á±MÉ¡
½¹Ñ¥¹Õ À°À°ÄÈà°ÄÈà°À°ÀÌØí±ÍÑà°ÀÌØí±ÍÑä¤(%%ÉɽÈôÄQ¡¸á¥Ñ1½½À(%
½¹Í½±]É¥Ñ ÅÕ½Ðì ÅÕ½ÐìµÀìÀÌØíÁÍlÁtµÀìÅÕ½Ðì°ÅÕ½ÐìµÀìÀÌØíÁÍlÅtµÀìÅÕ½Ðì¤ÅÕ½ÐìµÀì
I1¤($ÀÌØí±ÍÑàôÀÌØíÁÍlÁt($ÀÌØí±ÍÑäôÀÌØíÁÍlÅt)]¹

If it's not right then it's not far away ...

WBD

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...