how to save an ogl drawing to a jpg ?

You must create a new oglcanvas-like class which use a wx.MemoryDC()
instead the default wx.ScrolledWindow used by ShapeCanvas in
wx.lib.ogl.
I've done that in a project, If I can get some spare time I can
provide you a code example.

···

2010/2/9 joe <etaoinbe@yahoo.com>:

I have code that generates a drawing on a oglcanvas. How can I save
this to a jpg file ?

tx
J

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
EXPO - Hardware solution, Software revolution
http://www.expobrain.net

Esposti Daniele
Via Aldo Moro, 14/h
20085 - Locate di Triulzi (MI)
Cell +39 347 0748470

It doesn't need to be that complex. You should be able to just do

  canvas.GetDiagram().Redraw(dc)

Where dc is a wx.MemoryDC that has a bitmap of the right size selected into it. Then delete the dc and save the bitmap to a file.

···

On 2/9/10 7:42 AM, Daniele Esposti wrote:

2010/2/9 joe<etaoinbe@yahoo.com>:

I have code that generates a drawing on a oglcanvas. How can I save
this to a jpg file ?

You must create a new oglcanvas-like class which use a wx.MemoryDC()
instead the default wx.ScrolledWindow used by ShapeCanvas in
wx.lib.ogl.
I've done that in a project, If I can get some spare time I can
provide you a code example.

--
Robin Dunn
Software Craftsman

Very fast way to do that :slight_smile:

···

2010/2/9 Robin Dunn <robin@alldunn.com>:

On 2/9/10 7:42 AM, Daniele Esposti wrote:

2010/2/9 joe<etaoinbe@yahoo.com>:

I have code that generates a drawing on a oglcanvas. How can I save
this to a jpg file ?

You must create a new oglcanvas-like class which use a wx.MemoryDC()
instead the default wx.ScrolledWindow used by ShapeCanvas in
wx.lib.ogl.
I've done that in a project, If I can get some spare time I can
provide you a code example.

It doesn't need to be that complex. You should be able to just do

   canvas\.GetDiagram\(\)\.Redraw\(dc\)

Where dc is a wx.MemoryDC that has a bitmap of the right size selected into
it. Then delete the dc and save the bitmap to a file.

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
EXPO - Hardware solution, Software revolution

Esposti Daniele
Via Aldo Moro, 14/h
20085 - Locate di Triulzi (MI)
Cell +39 347 0748470