Sign in to follow this  
Followers 0
lucasdnd

PixelSearch bottom-to-top

4 posts in this topic

#1 ·  Posted (edited)

Hi all!

I've been using PixelSearch to do some suff here... and I realized it searches pixels from the top to the bottom of the screen.

"The search is performed left-to-right, top-to-bottom and the first match is returned." - Help File on PixelSearch

I wonder if there is any way to change it, and start the search from the bottom. I looked for it here in the forums and in the help file, but didn't find anything...

Thanks for the help

Edited by lucasdnd

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I haven't tested this, but would something like this work?

OK, I couldn't help it, I tested it, and made some changes. Seems to work.

$aPix = _PixelSearchRev(0, 0, @DesktopWidth, @DesktopHeight, 0xFFFFFF)
If Not @error Then
    MsgBox(0, "Return", $aPix[0] & ", " & $aPix[1])
EndIf

Func _PixelSearchRev ( $left, $top, $right, $bottom, $color, $shadeVar = 0, $step = 1 )
    Local $i, $j, $aRet
    For $i = $bottom To $top Step -1
        For $j = $right to $left Step -$step
            $aRet = PixelSearch( $j, $i, $j, $i, $color, $shadeVar )
            If Not @error Then
                Return $aRet
            EndIf
        Next
    Next
    SetError(1)
EndFunc
Edited by bluebearr

BlueBearrOddly enough, this is what I do for fun.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I hadn't thought I could do that lol. Thanks a lot bluebearr. I'll test it later =)

Edited by lucasdnd

Share this post


Link to post
Share on other sites

...

OK, I couldn't help it, I tested it, and made some changes...

:-)

Spoken like a true AutoIt addict.

:-)

Thanks for all of the help that you give to the forum... keep up the good work.

-MSP-


[size="1"][font="Arial"].[u].[/u][/font][/size]

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  
Followers 0