Displaying SVG in tkinter using cairo and rsvg

Martin P. Hellwig martin.hellwig at dcuktec.org
Wed Feb 16 10:49:10 CET 2011


On 02/16/11 09:04, Arndt Roger Schneider wrote:
<cut>
> raster images from SVG:
> There are multiple methods to convert a scalable vector graphic
> into a bitmap.
> In addition to cairo, librsvg and rsvg imageMagick contains a
> vector graphic format similar to svg--gradients and transparency
> are problematic for this approach, but its a while since I had
> looked into it...
>
> My product Jeszra imports svg into Tk(using tkpath
> http://jeszra.sourceforge.net/jeszra/Jeszra_TechnicalNotes.html#d0e10279
> ), preserving it as a vector graphics.
> There are, of course, limitations to what can be preserved in Tk:

tkpath does not seem to come standard with Python's tk version when I 
looked into it a couple of years ago, but maybe it has now?

<cut>
> Is there anyting else You want to know about svg?
>

No not really :-), I just wanted to display a SVG in tkinter with the 
minimal amount of external dependencies, since I have achieved that I 
thought I share my experience, so that the next time someone google 
tkinter and display svg it will return something that (well at least of 
the time of this writing) worked.

Thanks for the info though.

-- 
mph







More information about the Python-list mailing list