Screen capture and Menus [message #445364] |
Thu, 04 November 2004 13:25 |
Larry Bergman Messages: 3 Registered: July 2009 |
Junior Member |
|
|
I'm working on a screen capture utility. I'm able to grab images of
Controls, but am strugging with popup Menus. There seem to be two
problems. First, it appears that there's no way to determine the Menu
location. Menu has no getBounds method. Although MenuItem has a
getBounds, it seems to always return (0,0,0,0).
The second problem is in capturing the Menu rendering. I've tried
grabbing the display when the SWT.Show event is issued, and also when the
SWT.Selection event is issued. In neither is the Menu visible. I have a
hunch that because the menu is handled by the OS, it is never actually
"visible" to SWT.
Can anyone give me tips that might help with getting my screen capture to
handle this case?
Thanks much,
Larry
|
|
|
Re: Screen capture and Menus [message #445395 is a reply to message #445364] |
Thu, 04 November 2004 22:32 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
The menu is visible but SWT.Show comes before the menu is shown (so you can
add and delete items) and SWT.Selection comes after the menu is hidden. If
you call Display.asyncExec() to run the screen capture code after SWT.Show
completes, then you should be able to get a screen shot that includes the
menu. I haven't tried it but it should work.
"Larry Bergman" <bergman@us.ibm.com> wrote in message
news:cmdak2$cf3$1@eclipse.org...
> I'm working on a screen capture utility. I'm able to grab images of
> Controls, but am strugging with popup Menus. There seem to be two
> problems. First, it appears that there's no way to determine the Menu
> location. Menu has no getBounds method. Although MenuItem has a
> getBounds, it seems to always return (0,0,0,0).
>
> The second problem is in capturing the Menu rendering. I've tried
> grabbing the display when the SWT.Show event is issued, and also when the
> SWT.Selection event is issued. In neither is the Menu visible. I have a
> hunch that because the menu is handled by the OS, it is never actually
> "visible" to SWT.
>
> Can anyone give me tips that might help with getting my screen capture to
> handle this case?
>
> Thanks much,
> Larry
>
|
|
|
Powered by
FUDForum. Page generated in 0.02676 seconds