capturing contents of wxWindow into an image

Hi,

Is there a way to programmatically capture the contents of a
wxWindow into an image file? The only device context I have to work with is a
wxPaintDC which is not buffered. The device context goes out of scope after
the OnPaint method goes out of scope.

In a nutshell, I need a way to program taking a screen
snapshot for a defined region within a wxWindow.

Thanks.