I need to be able to draw SVG images (with the ability to scale, and rotate the images by 90,180 and 270 degrees).
I also want the ability of instead of rendering the images to a bitmap (e.g. for displaying), to be able to draw them into a new SVG image (exporting the "document" to SVG).
wxWidgets does not seem to have any built in SVG capabilities, so I'm not sure how to proceed on adding such functionality.
The cairo library website has examples on drawing SVG using librsvg.
Both the cairo and librsvg libraries should be sufficiently cross-platform to do what you need, and with wxcairo it should be possible to dock them onto wxWidgets.
That is the first idea I would research when faced with the task of drawing SVG into wxWidgets.
Also, drawing to SVG files with cairo is quite easy when you are doing all your drawing with cairo anyway, and the drawing model cairo uses is quite similar to SVG.
You can render into a file in SVG format using wxSVGFileDC (http://docs.wxwidgets.org/trunk/classwx_s_v_g_file_d_c.html) but there is no support for drawing SVG images, you will need to use an SVG rendering library and integrate it with wx (how to do this is platform-dependent).
Notice that wxSVGFileDC is in contrib, i.e. an additional library which needs to be built independently, in wx 2.8 but is in the main library itself in 2.9.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With