[GC] Capture offscreen image [message #449003] |
Mon, 17 January 2005 16:35 |
Arnaud Messages: 60 Registered: July 2009 |
Member |
|
|
Hi !
I use this piece of code to capture shells or widgets and display the
image created in my app.
private static Image snapshot(Composite bean) {
GC gc = gc = new GC(bean);
final Image image = new Image(null, bean.getBounds().width,
bean.getBounds().height);
gc.copyArea(image, 0, 0);
gc.dispose();
return image;
}
Now that all works fine, I put the shell or widget to capture offscreen
(setLocation (-100, -100)) and what do I get ? A blank snapshot (or a
half blank / half widget snapshot if widget's width is more than 100).
So It seems that shells are not drawn when not on screen. Or are they
invisible ? Or do you have to use another method that GC.copyArea to get
capture ?
How can you make offscreen captures ?
TIA
--
Arnaud
|
|
|
Powered by
FUDForum. Page generated in 0.02643 seconds