ReadPixelFast Color

Blitz3D Forums/Blitz3D Beginners Area/ReadPixelFast Color

boomboom(Posted 2004) [#1]
Hi, I am having trouble understanding the readpixelfast command,

i have drawn something, locked the buffer run this

pixelcolour% = ReadPixelFast (220, 100)

then unlocked the buffer and printed the pixelcolour% and i get some wierd results. for example pure white is -1.

am i using this command right and if so is there anyway to convert it to a proper useable rgb value?


BlackD(Posted 2004) [#2]
red% = PixelColor% Shr 16 And 255 And Shl 0
green% = PixelColor% Shr 8 And 255 And Shl 0
blue% = PixelColor% Shr 0 And 255 And Shl 0
+BlackD


boomboom(Posted 2004) [#3]
thanks, it works fine but I didn't use the code "and shl 0" on the end of any.