wxpython users,
Is there any way to get a snapshot of the window that is not on top? I tried
to use wxClientDC but it gets whatever is currently displayed on the screen
within the boundaries of that window, not the actual contents of the window.
E.g. if I have a message box on top of the window I am trying to get a
snapshot of, I get the image with that message box present as well.
I could not see that your question was answered over the weekend. I
apologize if I missed the reply.
In general, there is no way to do this. The contents of a partially or
totally covered window simply do not exist. Windows and X give you the
IMPRESSION of a set of full windows that stack on each other just like papers
on a desktop, but it's only a metaphor. When a window is covered by another,
the old contents are erased forever. When a hidden window is brought to the
top, the application must recreate the contents of its window from scratch.
There are certain exceptions. An X server can be configured to use "backing
store", in which your window is drawn to offscreen memory and refreshed to
the screen as needed. In that case, the full window contents are always
available. This is not commonly enabled, however, and there is no parallel
in Windows.
(One of the current discussions on the XFree86 developer's mailing list
involves this very topic. Many folks are arguing that a window should never
have to redraw itself: we have more than enough system and frame buffer
memory to keep the full contents of even complicated OpenGL windows around
forever. Thus, this situation might change in the future.)
Or, perhaps there may be a way to force an arbitrary wxWindow to paint into
a wxMemoryDC versus painting on the screen (wxPaintDC) without modifying the
window code itself? Somehow I doubt that re-writing of all the wxDC methods
will help - most controls will call the C code, ignoring all the changes in
Python.
Not in general, no. Many Windows controls create their own DCs when they
redraw themselves.
I apologize if my questions are plain dumb - I am still learning how
wxPython works.
This is not really a wxPython issue, it is a Windows or X issue. The same
thing happens with C apps.
You do not need to apologize. This is an area that is not at all obvious
when one is doing GUI programming.
···
On Fri, 22 Nov 2002 23:52:34 -0500, Vadim Bich <avbich@optonline.net> wrote:
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.