GetColor fast
Blitz3D Forums/Blitz3D Beginners Area/GetColor fast
| ||
I am making program that needs to have the rgb values separate like GetColor gives you. But GetColor Is way to slow. Any ideas? |
| ||
Use readpixelfast and convert the rgb values to red , green , and blue components as follows:col=readpixelfast(x,y) r=(col shr 16) and 255 g=(col shr 8) and 255 b=col and 255 |
| ||
You will need to LockBuffer on what your reading though. And that takes time. So just for one pixel, your best off just using readpixel. In tests it's faster for one pixel, than locking the buffer, using readpixelfast, then unlocking the buffer. |