save an opengl canvas (wxPython)

Zunbeltz Izaola zunbeltz at
Wed Dec 15 11:57:57 CET 2004

"Mike C. Fletcher" <mcfletch at> writes:

> There's sample code in PyOpenGL and OpenGLContext for saving canvases
> to PNG or JPEG formats using PIL.  Saving to Postscript requires
> considerably more work (if you're implying saving as triangles, lines
> and the like).  There is a GPL library which lets you do this, and I
> have an old SWIG wrapper for it sitting around somewhere (I think,
> haven't touched it in years), but even then, it's fairly poor quality
> compared to capturing a bitmap image.
> Anyway, the function for reading a buffer is glReadPixels:
> see the end of that man page for pointers to Python sample code.
> Good luck,
> Mike

Hi Mike,

Thanks for the answer. I'll check the code. For the moment png or jpeg
is ok, but maybe in the future i'll like to save the image as
postscript to use it with LaTeX font and so on. I've se the gl2ps
library and the last version is 21 September 2004. Can you send me
the SWIG file? I don't know much about swig and it would be easier
to start with a file that has work in same older version.

Thanks again


Zunbeltz Izaola Azkona                    |  wmbizazz at lg dot ehu
Materia Kondentsatuaren Fisika Saila      |
Zientzia eta Teknologia Fakultatea        |  Phone: 34946015326
Euskal Herriko Unibertsitatea             |   
PK 644                                    |  Fax:   34 944648500
48080 Bilbo (SPAIN)                       |

More information about the Python-list mailing list