I would suggest using readpixelfast. You will have to lock your buffers first though and unlock after you've done your readpixelfast so it's best to do all your pixel checks at the same time.
http://www.blitzbasic.com/codearcs/codearcs.php?code=551 might help
http://www.blitzbasic.com/codearcs/codearcs.php?code=551 might help