SWT: Как “представить” Виджет в фоновом режиме / в offscreenbuffer

Вы попробовали решение, предложенное на Форуме MSDN "Windows Forms, Общие" , который просто разделяет TextBox на подклассы?

6
задан jan 3 December 2009 в 09:45
поделиться

1 ответ

I can't answer your question directly, but I have run into a similar problem that I struggled with: taking a screenshot of a Shell or Widget while it is obstructed from view.

Consider, for instance, window A that overlaps window B. A screenshot is made of B using your code:

Image screenshot = new Image(shellB.getDisplay(), shellB.getBounds());
GC.copyArea(screenshot, 0, 0);

My findings revealed that this could be done under Windows Vista, Windows 7 and Mac OS X (although I'm unsure about the latter). However, under Windows XP, Linux with GNOME and Linux with KDE, the screenshot contains a white area where the overlapping window obstructs the view.

I haven't found a solution for this, and I suspect that not only is this behavior platform dependent, but also fairly buggy in SWT.

I'd love to hear that I'm off the mark, though!

2
ответ дан 17 December 2019 в 20:32
поделиться
Другие вопросы по тегам:

Похожие вопросы: