How to get individual R,G,B, values of a pixel?

BlitzPlus Forums/BlitzPlus Beginners Area/How to get individual R,G,B, values of a pixel?

Galdy(Posted 2011) [#1]
I was wondering if and how you can get the individual rgb values of a pixel. Red=value, G=Value, B=Value

I tried
rgb=readpixel(x,y)and $ffffff,

but it gives one long number which i don't know what to do with.


Galdy(Posted 2011) [#2]
oops, i meant this for the bltiz3d forum.


GfK(Posted 2011) [#3]
rgb = readpixel(x,y)
r = (rgb shr 16) & $FF
g = (rgb shr 8) & FF
b = rgb & $FF

Probably.


Matty(Posted 2011) [#4]
see thread in blitz3d forum (same applies here though too)