Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » saving figure into file
saving figure into file [message #238404] Mon, 10 September 2007 01:21
Eclipse User
Originally posted by: puneet82sri.sify.com

Hi all,
I need to save my draw2d figure into a file.
I was able to save it but my requirement is a bit restricted. I don't need to open the shell. I want draw2d to draw figures and save into file in backgroud.

I am using the below code to save contents figure:
Image img1 = new Image(null, new org.eclipse.swt.graphics.Rectangle(10, 102, 600, 600));
GC gc1 = new GC(img1);

Graphics grap1 = new SWTGraphics(gc1);
contents.paint(grap1);
ImageLoader loader1 = new ImageLoader();

loader1.data = new ImageData[] {img1.getImageData()};
loader1.save("c:/draw2d.jpeg", SWT.IMAGE_JPEG);

Thanks
Puneets
Previous Topic:Eclipse 3.3.0 GEF fails with IndexOutOfBoundsException - works on Eclipse 3.2.1
Next Topic:Problems with scrolling
Goto Forum:
  


Current Time: Sun Apr 20 09:26:00 EDT 2014

Powered by FUDForum. Page generated in 0.01906 seconds