Paint a component, that is invisible or only partly visible, into an Image
800390Jul 22 2008 — edited Jul 22 2008Hello,
I would like to render a component into an Image. This is not that hard to do, I just create a new Image object, get the graphics object from the image and use the paintComponents( g ) method of the component to draw it into the Image.
But here is my problem:
I would like to be able to render the component into the Image without displaying the image. Or another case is, when I add the component that I want to render to a container, that is smaller the the component, only the part that is visible will be rendered.
Does anyone know how to skip the optimization, that Swing does not paint on invisible areas? Or is it the case, that a component MUST be fully visible and added to another container to render it into an Image?
Thanks a lot for your help!