How to Draw SVG in Wxpython ?

I want to create a SVG Editor in Wxpython

···


┌─────────────────────────┐
│ Narendra Sisodiya
http://narendrasisodiya.com
└─────────────────────────┘

there is no built-in support.

However:

SVG is XML, so you ca use one of the XML packages to read/write it.

wx.GraphicsContext uses a similardrawing model, so you should be able to do the drawing pretty easily. In fact, a couple years back someone write a minimal SVG renderer in wxPython -- some googling should find it.

You might also want to take a look at Cairo -- you can render to a wxWindow with Cairo, and it has some advantages over wxGraphicsContext.

You may want to take a look at FloatCanvas2:

http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/branches/FloatCanvas/SOC2008_FloatCanvas/floatcanvas2/

It was developed as a Google Summer of Code project, and is not quite complete, but has a lot of nifty stuff in it.

You could also look at FloatCanvas in wx.lib.floatcanvas -- it used wx.DCs primarily, so does not support many of the SVG features (alpha blending, proper spline paths, etc. But it could be adapted to use GCs (or Cairo) and you can get ideas from it as well.

Making a full-featured editor is still a massive project, however.

Good luck!

-Chris

···

On 8/26/11 10:49 AM, Narendra Sisodiya wrote:

I want to create a SVG Editor in Wxpython

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

I want to create a SVG Editor in Wxpython

there is no built-in support.

However:

SVG is XML, so you ca use one of the XML packages to read/write it.

wx.GraphicsContext uses a similardrawing model, so you should be able to do the drawing pretty easily. In fact, a couple years back someone write a minimal SVG renderer in wxPython – some googling should find it.

Thanks,

Making a full-featured editor is still a massive project, however.

I want minimal… I have done over Web but now I want a desktop client.

···

On Fri, Aug 26, 2011 at 11:30 PM, Chris.Barker Chris.Barker@noaa.gov wrote:

On 8/26/11 10:49 AM, Narendra Sisodiya wrote: