int figureWidth = (int)Math.ceil(figure.size.getX());
int figureHeight = (int)Math.ceil(figure.size.getY());
Image image = new Image(getDisplay(), figureWidth, figureHeight);
GC gc = new GC(image);
SWTGraphicsContext swtGC = new SWTGraphicsContext();
swtGC.setGC(gc);
gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
figure.draw(new Coordinate(1.0, 1.0), swtGC, new Rectangle(0, 0, figureWidth, figureHeight), new SWTElementsVisibilityManager().getVisibleSWTElementsVector());