Hi,
I try to export a Figure into JPG image (or any image formats). If the
width of my Figure is < 2200 the export works well, otherwise it does an
OutOfMemory exception, even if my figure is only composed of box's and
circles filled.
Do you think that I should post it on the SWT newsgroups instead ? Or it
is typical problem of draw2D ?
The sinpet here shown how I export in Jpg.
final Image image = new Image(null, rectangle.width,
rectangle.height);
GC gc = new GC(image);
Graphics graphics = new SWTGraphics(gc);
graphics.translate(draw2DFigure.getBounds().getLocation().getNegated());
draw2DFigure.paint(graphics);
graphics.dispose();
gc.dispose();
ImageData data = image.getImageData();
ImageLoader loader = new ImageLoader();
loader.data = new ImageData[1];
loader.data[0] = data;
loader.save(filename, SWT.IMAGE_JPEG);
Thanks !!
Sabri.