I have a zest(1.5.0) graphViewer which is quite large as a result scrollbar appears in the composite. Now when I am trying to export this graph as a png I am getting only the visible portion of the graph.Region beyond the scrollbars is not available in the image.
Image image = new Image(PlatformUI.getWorkbench().getDisplay(), composite.getBounds().width, composite.getBounds().height); ImageLoader loader = new ImageLoader();
GC gc = new GC(image);
composite.print(gc);
gc.dispose();
loader.data = new ImageData[]{image.getImageData()};
loader.save("c:/raja/graph.png", SWT.IMAGE_PNG);
If I use graphViewer object it gives nodes collapsed on the top left corner
GC gc = new GC(viewer.getGraphControl());
Rectangle bounds = viewer.getGraphControl().getBounds();
Image image = new Image(viewer.getGraphControl().getDisplay(), bounds);
**<Rest same as above code>**
I need to get a single image with complete graph in it.Is there a way to achieve this. I think animation could be causing the clustering of nodes in second approach.Is there a way to turn it off (I tried setting nodeStyle to ZestStyle.No_Animation_Layout but it did not help the cause).