• Advertisement
Sign in to follow this  

[java] Copy data from one Graphics component to another Graphics component

This topic is 4730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Situation: Graphics GraphicsA; Graphics GraphicsB; How can I copy a a peace from GrahphicsA to GrahphicsB!?

Share this post


Link to post
Share on other sites
Advertisement
Maybe these will work for you?

Graphics create()
Creates a new Graphics object that is a copy of this Graphics object.
Graphics create(int x, int y, int width, int height)
Creates a new Graphics object based on this Graphics object, but with a new translation and clip area.

Share this post


Link to post
Share on other sites
If your trying to get Data from the BufferedImage that the Graphics2D A is pointed at over to the BufferedImage that Graphics2D B points at, the only way to do it is through the BufferedImages.... You can't obtain a raster, or Image Data through a Graphics2D.

If your trying to get it from one componant to another, you have to get their display buffer, not their Graphics2D.

I would really like if you could (it would help me a bunch) but the Graphics2D object wasn't made for that.

Hope this helps...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement