You should be able to create the functionality you're after. I imagine there's a better way that this, but this is just off the top of my head. Since it not so easy to get an Image object from graphics object, you should create an image, get the graphics object from that and draw in this, then use the
drawImage(Image img, int x, int y, ImageObserver observer)
method to put you graphics on the screen. So far things should work as normal. But now you have an Image object that represents the image on the screen. So use a java.image.PixelGrabber to get the pixels repesenting the onscreen image. With the right mapping of the pixel array to the on-screen image location, you can have the mouse position indicate exactly what pixel it's over. Now you can examine the pixel any way you want. The pixel grabber api shows some sample code of how to get the individual RGB values from and image. I'm sure there are some tutorial out there as well (though with a quick search, I didn't come up with much). As well, if you want a great book, have a look at
Digital Image Processing: A Practical Introduction Using Java
.
Sean