quixote79 Posted October 9, 2005 Share Posted October 9, 2005 (edited) Func _PixelSearchinCircle($centerX, $centerY, $radius, $color, $shadevariation = 0, $step = 1) If ($centerX - $radius < 0) or ($centerY - $radius < 0) or ($centerX + $radius > @DesktopWidth) or ($centerY + $radius > @DesktopHeight) Then SetError(2) Else Local $xs[ ($radius + 1) * 2], $xe[ ($radius + 1) * 2] For $i = -$radius To $radius Step 1 $xs[$i + $radius] = Round($centerX - Sqrt($radius ^ 2 - $i ^ 2)) $xe[$i + $radius] = Round($centerX + Sqrt($radius ^ 2 - $i ^ 2)) $point = PixelSearch($xs[$i + $radius], $centerY + $i, $xe[$i + $radius], $centerY + $i, $color, $shadevariation, $step) If Not @error Then Return $point ExitLoop EndIf Next EndIf EndFunc ;==>_PixelSearchinCircle Syntax is same to PixelSearch(), but if range is invalid, it returns @error=2. Tell me if you find any problem, plz. ^^ Edited October 9, 2005 by quixote79 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now