Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What you're asking is very close to saying you want to take a screenshot. Although technically grabbing a copy of what the window currently looks like is not the same as cloning what the OnPaint does, it's possible it would do the job for you.</p> <p>If it doesn't work, take note of the technique, including the use of DC.Blit(), as those would be the tools you'd use.</p> <p>See this <a href="http://groups.google.com/group/wxpython-users/browse_thread/thread/844ddd8b705395d7/bcad54c2eb35dd81?lnk=gst&amp;q=andrea+gavana+screenshot#bcad54c2eb35dd81" rel="nofollow noreferrer">wxpython-users mailing list post by Andrea Gavana</a> for image-grabbing code.</p> <p><strong>Edit:</strong> if the problem is that because you're doing all your drawing <em>inside</em> the EVT_PAINT handler, then you probably need a different technique. Draw everything from a different routine to a pre-allocated buffer bitmap. Inside the OnPaint, which is just how the image actually gets to the screen, you don't draw, you just copy the already-drawn bitmap. The buffer bitmap persists between OnPaint calls (and in fact is basically independent of OnPaint), so you can add a Save() routine that works rather simply as well. See the <a href="http://wiki.wxpython.org/DoubleBufferedDrawing" rel="nofollow noreferrer">wxPyWiki DoubleBuffererDrawing</a> page for various snippets that will show you how to do that. (Also note, this will be a bit of a learning curve, so ask for more help if it's not enough.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload