Get color of pixel under mouse cursor
BlitzMax Forums/BlitzMax Beginners Area/Get color of pixel under mouse cursor
| ||
| I would like to be able to get the RGB value of the pixel under the mouse cursor, but I can't seem to find a command that will help me do this. What I had in mind is similar to the 'eyedropper' tool in most paint and photo editing programs, allowing the user to copy the color clicked on. Is there a reciprocal to the 'Plot' command? Thanks, -Medicine Storm |
| ||
| Grab the screen to a pixmap then use readpixel? |
| ||
| Think you need to grabpixmap and then readpixel. <edit> Argh |
| ||
| |
| ||
| @Plash: Fast, easy and exactly what I was looking for. Thank you! -Medicine Storm |
| ||
| Color box.. |
| ||
| Note that reading the backbuffer into a pixmap is NOT a fast process, relatively speaking. Data has to be transferred over the graphics bus. Even reading a small area as a pixmap can affect your framerate, so it's not something that you want to do lots of times. If you need to read many pixels, read a rectangular area and then pick out the pixels you want. |