Conversion of drawn shapes on a panel or canvas into Image
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sanjeev_Dhiman
Posted On:   Wednesday, September 26, 2001 04:47 AM



I have drawn few shapes on a panel and now i want to save those shapes as a image object so that the original things can be drawn on some other panel.
How can I do so ?
plzzzzzzzzzzzzzzzzzzzzzzzz.

Re: Conversion of drawn shapes on a panel or canvas into Image

Posted By:   Ian_Mechura  
Posted On:   Friday, September 28, 2001 03:15 PM

You would create a blank Image() Object
prefferably a BufferedImage(). then you
would create an offScreen Graphics
Object of this image.


eg.



BufferedImage buff = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);


Graphics offScr = buff.createGraphics();



Then any thing that you draw to the
Graphics Context is consequentially drawn
to the BufferedImage() Object;

Hope that helps,
Ian
About | Sitemap | Contact