I've got a wxOGL app which I want to be able to serve (with only partial functionality) via from a webserver. I think the easiest way to do this would be to dump the canvas to an image, and send it with an imagemap.
Does anybody have any recommendations for how to do this? Is there anything so simple as 'save dc as image.' It looks like you can save as postscript, which I could then convert, but before I dig in I was wondering if anyone could suggest a bettwer way.
I've got a wxOGL app which I want to be able to serve (with only
partial functionality) via from a webserver. I think the easiest way
to do this would be to dump the canvas to an image, and send it with
an imagemap.
Does anybody have any recommendations for how to do this? Is there
anything so simple as 'save dc as image.' It looks like you can save
as postscript, which I could then convert, but before I dig in I was
wondering if anyone could suggest a bettwer way.
Create an wxEmptyBitmap of the correct size and select it into a wxMemoryDC. Then Blit from a wxClientDC of the window to the wxMemoryDC. Now the image is in the bitmap which can be saved to a file in several different image formats.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
The same code under windows works as intended.
Under Linux beside the exposed problem, double clicking on button puts
it in "clicked/down" state, till the panel is clicked.
(The EVT_LEFT_DCLICK is binded like other mouse events.)
···
On Wed, 2003-06-11 at 09:32, Alessandro Iob wrote:
I'm binding the EVT_MOTION both on the button and on its parent window.
I'm using wxPythonGTK-py2.2-2.4.0.7 under linux.
I have a program with a couple of wxpanels, but now i would like to
onbuttonclick
let another new panel popup and in this panel buttons etcetera. is this
possible?
Are you binding the EVT_MOTION event to the button or to its parent window? What platform and version?
I'm binding the EVT_MOTION both on the button and on its parent window.
I'm using wxPythonGTK-py2.2-2.4.0.7 under linux.
I should have guessed that you were on Linux, but saying that the events were coming from the parent when you didn't mention having bound them there before threw me off. The trouble is that in gtk the button (and some others) is not a true window, but just a widget that is drawn directly on its parent window. This means that the widget doesn't get the events directly but has to get the ones it is interested in from the parent, and unfortunatly it doesn't care about the motion events...
···
On Tue, 2003-06-10 at 19:29, Robin Dunn wrote:
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I have a program with a couple of wxpanels, but now i would like to
onbuttonclick
let another new panel popup and in this panel buttons etcetera. is this
possible?
Yes. There are a few ways to do it, depending on how you want it to look/behave, but in general you just need to create the new panel just like any other, manage its size and position like any other, etc.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!