Have you looked at the PixelGrabber class? Its get and set methods might do what you want.