| saving figure into file [message #238404] |
Mon, 10 September 2007 01:21 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.01820 seconds