Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » rectangle area of Shell
rectangle area of Shell [message #449913] Mon, 31 January 2005 07:38 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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();
Previous Topic:J9 Compatiable SWT Browser
Next Topic:SWT for carpc GUI
Goto Forum:
  


Current Time: Tue Apr 23 07:33:45 GMT 2024

Powered by FUDForum. Page generated in 0.03574 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top