How to draw IFigure into Image [message #684898] |
Thu, 16 June 2011 08:54  |
Eclipse User |
|
|
|
Hi guys,
I have a draw2D graph represented by it's root IFigure. This graph is drawn on a FigureCanvas.
This canvas is resizable, so users can resize it in both directions.
Now I need to save this graph as an PNG image. I can save it this way:
IFigure graph = ....my graph
Image img = new Image(Display.getDefault(), graph.getBounds().width, graph.getBounds().height);
final GC imageGC = new GC(img);
Display.getDefault().syncExec(new Runnable() {
public void run() {
graph.paint(new SWTGraphics(imageGC));
}
});
imageGC.dispose();
But it always draw the actual size of the graph IFigure. I would like to draw it every time in my specific size.
How can I do that? For example 300 x 300.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03034 seconds