rectangle area of Shell [message #449913] |
Mon, 31 January 2005 07:38 |
Eclipse User |
|
|
|
Originally posted by: vafada2.yahoo.com
i was to capture a shell into a SWT Image class... the problem is the
image doesn't include the title bar of the shell (the bar with the icon,
title, minimize, maximize and close button). My image has the same width
and height of the shell but the copied image was able to capture some
part of the desktop that is not part of the SWT application since the
title bar was not included in the image.
here's some code snippet:
Rectangle displaySize = shell.getBounds();
GC gc = new GC(shell);
Image image = new Image(shell.getDisplay(), displaySize);
gc.copyArea(image, 0, 0);
i can adjust the arguements for copyArea but this is a dirty solution
and might not work correctly in other platforms.
any solution?
|
|
|
Re: rectangle area of Shell [message #450107 is a reply to message #449913] |
Tue, 08 February 2005 11:38 |
Eclipse User |
|
|
|
Originally posted by: michael.rothenbuehler.dvbern.ch
Hi Bryan
>....but the copied image was able to capture some
>part of the desktop that is not part of the SWT application....
I solved this problem with using:
Rectangle displaySize = shell.getClientArea()
instead of:
Rectangle displaySize = shell.getBounds();
|
|
|
Powered by
FUDForum. Page generated in 0.03574 seconds