how do you get RGB value of pixel?

Blitz3D Forums/Blitz3D Beginners Area/how do you get RGB value of pixel?

767pilot(Posted 2004) [#1]
I would like to find a pixel colour at position x,y

ie I want to see if a pixel at 40,50 is magenta

How would I do this please?

Thanks for any help!

Graham


JazzieB(Posted 2004) [#2]
GetColor 40,50

r=ColorRed()
g=ColorGreen()
b=ColorBlue()


Or, read up on ReadPixel() and ReadPixelFast()


Rob Farley(Posted 2004) [#3]
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