I using the code from the wiki Working With Images to capture a bmp from
the screen of a small wxPanel. This works great until the panel is
partially out of view on a wxScrollWindow. I was thinking of scrolling the
window and then screen capture however it might be nicer to get the bmp
some other way (without having to scroll the window).
Well, if you're only interested in that specific bitmap (supposing it is
a bmp) why don't you use the wxBitmap's SaveFile() method ? If your
drawing in a wxMemoryDC, keep a reference to it and do the same.
disclaimer: I've never used SaveFile() myself...
···
On Thu, 2003-12-11 at 20:46, Nigel Moriarty wrote:
Folks
I using the code from the wiki Working With Images to capture a bmp from
the screen of a small wxPanel. This works great until the panel is
partially out of view on a wxScrollWindow. I was thinking of scrolling the
window and then screen capture however it might be nicer to get the bmp
some other way (without having to scroll the window).
Any ideas?
Nigel
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
--
Thys Meintjes
BEng Electronic (UP), MEng Bio (UP)
Intrepid Investigator of Interesting Things
+27 82 3764 602
I'm sorry I wasn't clearer. When the panel is partly covered by something
like the scroll bars, the screen captured bitmap reflects that. I was
hoping to get a accurate bitmap of the panel even thought some of it is hidden.
Nigel
PS The SaveFile works fine but its the bitmap that is 'corrupted'.
···
On 11 Dec 2003 21:04:42 +0200 Thys Meintjes <thys@netsys.co.za> wrote:
Well, if you're only interested in that specific bitmap (supposing it is
a bmp) why don't you use the wxBitmap's SaveFile() method ? If your
drawing in a wxMemoryDC, keep a reference to it and do the same.
disclaimer: I've never used SaveFile() myself...
On Thu, 2003-12-11 at 20:46, Nigel Moriarty wrote:
> Folks
>
> I using the code from the wiki Working With Images to capture a bmp
from
> the screen of a small wxPanel. This works great until the panel is
> partially out of view on a wxScrollWindow. I was thinking of
scrolling the
> window and then screen capture however it might be nicer to get the bmp
> some other way (without having to scroll the window).
>
> Any ideas?
>
> Nigel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
> For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org
Yes after I send the prev mail of I realised I probably got the wrong
end of the stick, email is forever....
Anyway, I recently wrote a a screen grabber also heavily based on the
wiki code. The grab dialog has a chekbox that allows the user to either
grab the whole (main) frame, or only the panel beneath the pointer,
after hitting the grab btn, the grab dialog hides itself, waits 2
seconds to allow the underlaying panels to repaint themselves and then
'grabs' the panel.
At the time I thought that it would be nice if one could somehow attach
a 'clean' DC to the panel and clone its contents with a Refresh()
equivalent, or for that matter a SaveFile() method for wx.Window. That
way no 'hide & grab' footwork would be necessary. But I never found
anything...
···
On Thu, 2003-12-11 at 21:16, Nigel Moriarty wrote:
Thys
I'm sorry I wasn't clearer. When the panel is partly covered by something
like the scroll bars, the screen captured bitmap reflects that. I was
hoping to get a accurate bitmap of the panel even thought some of it is hidden.
Nigel
PS The SaveFile works fine but its the bitmap that is 'corrupted'.
On 11 Dec 2003 21:04:42 +0200 Thys Meintjes <thys@netsys.co.za> wrote:
> Well, if you're only interested in that specific bitmap (supposing it is
> a bmp) why don't you use the wxBitmap's SaveFile() method ? If your
> drawing in a wxMemoryDC, keep a reference to it and do the same.
>
> disclaimer: I've never used SaveFile() myself...
>
> On Thu, 2003-12-11 at 20:46, Nigel Moriarty wrote:
> > Folks
> >
> > I using the code from the wiki Working With Images to capture a bmp
> from
> > the screen of a small wxPanel. This works great until the panel is
> > partially out of view on a wxScrollWindow. I was thinking of
> scrolling the
> > window and then screen capture however it might be nicer to get the bmp
> > some other way (without having to scroll the window).
> >
> > Any ideas?
> >
> > Nigel
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
> > For additional commands, e-mail:
> wxPython-users-help@lists.wxwindows.org
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
--
Thys Meintjes
BEng Electronic (UP), MEng Bio (UP)
Intrepid Investigator of Interesting Things
+27 82 3764 602
At the time I thought that it would be nice if one could somehow attach
a 'clean' DC to the panel and clone its contents with a Refresh()
equivalent, or for that matter a SaveFile() method for wx.Window. That
way no 'hide & grab' footwork would be necessary. But I never found
anything...
Thys
That's too bad because this is exactly what I would like. If something
doesn't appear on the list that does it, I'll be doing something similar to you.
Nigel
···
On 11 Dec 2003 21:50:03 +0200 Thys Meintjes <thys@netsys.co.za> wrote:
On Thu, 2003-12-11 at 21:16, Nigel Moriarty wrote:
> Thys
>
> I'm sorry I wasn't clearer. When the panel is partly covered by
something
> like the scroll bars, the screen captured bitmap reflects that. I was
> hoping to get a accurate bitmap of the panel even thought some of it
is hidden.
>
> Nigel
>
> PS The SaveFile works fine but its the bitmap that is 'corrupted'.
>
> On 11 Dec 2003 21:04:42 +0200 Thys Meintjes <thys@netsys.co.za> wrote:
>
> > Well, if you're only interested in that specific bitmap (supposing
it is
> > a bmp) why don't you use the wxBitmap's SaveFile() method ? If your
> > drawing in a wxMemoryDC, keep a reference to it and do the same.
> >
> > disclaimer: I've never used SaveFile() myself...
> >
> > On Thu, 2003-12-11 at 20:46, Nigel Moriarty wrote:
> > > Folks
> > >
> > > I using the code from the wiki Working With Images to capture a bmp
> > from
> > > the screen of a small wxPanel. This works great until the panel is
> > > partially out of view on a wxScrollWindow. I was thinking of
> > scrolling the
> > > window and then screen capture however it might be nicer to get
the bmp
> > > some other way (without having to scroll the window).
> > >
> > > Any ideas?
> > >
> > > Nigel
> > >
> > >
> > >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwindows.org
> > > For additional commands, e-mail:
> > wxPython-users-help@lists.wxwindows.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
> For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org
> At the time I thought that it would be nice if one could somehow attach
> a 'clean' DC to the panel and clone its contents with a Refresh()
> equivalent, or for that matter a SaveFile() method for wx.Window. That
> way no 'hide & grab' footwork would be necessary. But I never found
> anything...
That's too bad because this is exactly what I would like. If something
doesn't appear on the list that does it, I'll be doing something similar to you.
This has come up before on this list, and I'm pretty sure what you want
is just not possible. wxWindows consistis of multiple layers, and some
stuff is drawn by wx, some by the native controls, etc. The result is
that there is no master DC that everything is being drawn to. wxClientDC
will get it's contents from the system frame buffer (I may have the
terms a little wrong here), and that shows what is actually being
displayed.
Note that what you want may just work on OS-X, because it supposedly
double buffers for you, but I havn't check this out.
-Chris
···
On 11 Dec 2003 21:50:03 +0200 Thys Meintjes <thys@netsys.co.za> wrote:
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Could you please post this on the Wiki? It gets asked here a fair bit.
-Chris
Thys Meintjes wrote:
···
Anyway, I recently wrote a a screen grabber also heavily based on the
wiki code. The grab dialog has a chekbox that allows the user to either
grab the whole (main) frame, or only the panel beneath the pointer,
after hitting the grab btn, the grab dialog hides itself, waits 2
seconds to allow the underlaying panels to repaint themselves and then
'grabs' the panel.
I using the code from the wiki Working With Images to capture a bmp from
the screen of a small wxPanel. This works great until the panel is
partially out of view on a wxScrollWindow. I was thinking of scrolling the
window and then screen capture however it might be nicer to get the bmp
some other way (without having to scroll the window).
Any ideas?
I've worked on some code to try and force an arbitrary window (either native controls or custom wxWindows) to draw itself to an arbitrary DC, such as a wxMemoryDC with a bitmap selected into it, and recursivly capturing the child windows too.
Windows has a WM_PRINT message that helps facilitate this, and I was able to get it to almost work perfectly on win2k or XP without themes enabled. Unfortunatly when you turn on themes for the app then (as usual with XP themes) almost nothing works at all, and when I tried the XP-specific APIs that sounded like they should do the job it got even worse.
On GTK it appears to be impossible to do anything like this, at least I could not find any APIs or sample code for it.
On OS X there are APIs similar to WM_PRINT on windows that should do the job, but I never got this far in my experimenting.
If anybody has info or ideas for solving this for XP or GTK I would love to hear about it as I would like to be able to add a wxWindow::DrawOnDC method that worked for any window on all three of the main platforms.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!