how do you get RGB value of pixel?

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

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

GetColor 40,50

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


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

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