I want to export a full scrolled composite to an image. I mean the whole composite, not just the visible area of the composite.
I found this example:
Image drawable = new Image(display, someComposite.getBounds());
GC gc = new GC(drawable);
mainWidget.print(gc);
ImageLoader loader = new ImageLoader();
loader.data = new ImageData[] {drawable.getImageData()};
loader.save("exportedImage.bmp", SWT.IMAGE_BMP);
drawable.dispose();
gc.dispose();
but the output is the visible area of the scrolled composite. 🙁 and not whole of it, I guess that because of the .getBound() method, but I cant find a way to switch it to another method. I tried .getClientArea() but it didn’t worked…
Thanks in advance,
Yossi.
I found an example and modified some stuff – just copy & paste it:
It’s working 🙂
and can be good point to start from.