=sinister= Posted October 18, 2010 Posted October 18, 2010 So I have a script that uses PixelSearch to check 1 pixel and see if it has changed past a certain tolerance. However, this method is slow and unreliable, and I was wondering if there is somehow a way to check 1 pixel (with tolerance) to see if it has changed. Maybe like PixelCheckSum but with a tolerance parameter.
Bowmore Posted October 18, 2010 Posted October 18, 2010 (edited) Something like this should work for you. #Include <Color.au3> $iTestColour = 0xAB1200 $iTolerance = 10 $var = PixelGetColor( 10 , 100 ) If (Abs(_ColorGetRed($var) - _ColorGetRed($iTestColour)) <= $iTolerance) _ And (Abs(_ColorGetBlue($var) - _ColorGetBlue($iTestColour)) <= $iTolerance) _ And (Abs(_ColorGetGreen($var) - _ColorGetGreen($iTestColour)) <= $iTolerance) Then MsgBox(0,"The colour matches", Hex($var,6)) Else MsgBox(0,"The colour does not match", Hex($var,6)) EndIf Edited October 18, 2010 by Bowmore "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
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