Finding Colour at Point on Screen
BlitzMax Forums/BlitzMax Beginners Area/Finding Colour at Point on Screen
| ||
I used to like the old color=Point(x,y) command they had in some old basics. Someone gave me a routine for doing this in Blitz ages ago, but I can't find it, can anyone help? I need it to find the colour at a point on a bitmap. So i can make tile data for irregular map tiles (like slopes etc). Thank you very much |
| ||
if its a bitmap you could use ReadPixel() on a TPixmap, if its the screen only way i see without breaking out platform specific code is GrabPixmap(). |
| ||
GrabPixmap is the way to go. But you don't need to grab the whole screen (unless you want to use ReadPixel a lot per cycle). Just grab a 1x1 pixmap which is basically the pixel you want to test. |
| ||
If you use OpenGL you can use a single call to glReadPixels() to read a single pixel into an integer variable. |
| ||
thank you very much , has anyone got a function to do it? i am a bit rusty |