rsvg

Putting .SVG images into tkinter Frame

China☆狼群 提交于 2020-12-23 02:10:57
问题 I have been trying to put the image from https://betacssjs.chesscomfiles.com/bundles/web/favicons/safari-pinned-tab.f387b3f2.svg into a Tkinter frame. I found from the post here that it is possible with the help from rsvg and cairo. I was using python 3.6 on Windows 10. I got rsvg from here and cairo from here and then extracted the folders to the 'C:\Users...\site_packages' folder. They import fine but I cannot figure out how to use them. I tried using the code: import tkinter as tk main=tk

Putting .SVG images into tkinter Frame

最后都变了- 提交于 2020-12-23 01:45:51
问题 I have been trying to put the image from https://betacssjs.chesscomfiles.com/bundles/web/favicons/safari-pinned-tab.f387b3f2.svg into a Tkinter frame. I found from the post here that it is possible with the help from rsvg and cairo. I was using python 3.6 on Windows 10. I got rsvg from here and cairo from here and then extracted the folders to the 'C:\Users...\site_packages' folder. They import fine but I cannot figure out how to use them. I tried using the code: import tkinter as tk main=tk

Putting .SVG images into tkinter Frame

我与影子孤独终老i 提交于 2020-12-23 01:44:31
问题 I have been trying to put the image from https://betacssjs.chesscomfiles.com/bundles/web/favicons/safari-pinned-tab.f387b3f2.svg into a Tkinter frame. I found from the post here that it is possible with the help from rsvg and cairo. I was using python 3.6 on Windows 10. I got rsvg from here and cairo from here and then extracted the folders to the 'C:\Users...\site_packages' folder. They import fine but I cannot figure out how to use them. I tried using the code: import tkinter as tk main=tk

Python SVG converter creates empty file

早过忘川 提交于 2020-01-14 08:44:08
问题 I have some code below that is supposed to convert a SVG image to a PNG. It runs without errors but creates a PNG file that is blank instead of one with the same image as the original SVG. I did find that it is not an error with cairo but more one relating to rsvg, which I got here. import cairo import rsvg img = cairo.ImageSurface(cairo.FORMAT_ARGB32, 640,480) ctx = cairo.Context(img) handle= rsvghandler.Handle('example.svg') handle.render_cairo(ctx) img.write_to_png("svg.png") I am using

SVG to PNG with multiple image layers using PHP

帅比萌擦擦* 提交于 2019-12-21 12:25:45
问题 I convert svg to png image with this code <?php exec('/usr/bin/rsvg-convert -w 1000 -h 1000 tshirt.svg -o tshirt.png'); ?> This works with a single svg image. Actually i have an svg image which contains multiple layers of images like: 1st layer -: this is the background T-shirt image which is transparent 2nd layer -: this is another T-shirt image which contains color 3rd layer -: this is the small sticker image which should be placed on the T-shirt My svg code is -: <?xml version="1.0"

rsvg with Python 3.2 on Ubuntu

时光毁灭记忆、已成空白 提交于 2019-12-18 04:54:31
问题 I am trying to use rsvg in Python 3.2 but I keep getting an import error. I have installed all of the librsvg packages along with cairo. I cannot find anything online about what else to install to get it to work. I did hear that the rsvg module hasn't been updated since 2005 so is it just not compatible with Python 3.2, or is there something else I can try to install it? Alternatively, if rsvg does not work, does anyone have any suggestions for a simple way to display an SVG file through

ImageMagick convert SVG to PNG not working with RSVG enabled

爱⌒轻易说出口 提交于 2019-12-18 04:47:07
问题 I'm using ImageMagick's convert utility to convert SVG file to PNG image. At first, I used vanilla installation of IM on OSX ( brew install imagemagick ) to convert the SVG using: $ convert file.svg file.png This worked except that some of the image objects in that file were offset (actual links to images). I then read a related question that suggested ImageMagick to be compiled with rsvg support (homebrew does it with brew install imagemagick --use-rsvg ). Now, when I try to perform the

Using RSVG to convert svg with non-local image

痴心易碎 提交于 2019-12-11 03:26:55
问题 I've got an SVG image as follows that I'm trying to convert to a PNG: <?xml version="1.0"?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image x="0" y="0" width="158" height="158" xlink:href="http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png" /> </svg> This was working on Ubuntu 10.04, but now on 12.04 it doesn't. The reason appears to be that RSVG now won't load any image URL that doesn't have a relative path. That's not an option here - my

How to install python-rsvg without python-gnome2-desktop on Ubuntu 8.10?

僤鯓⒐⒋嵵緔 提交于 2019-12-10 07:00:23
问题 I need rsvg support in Python 2.5.2. It appears that I have to install all 199 deps along with the package python-gnome2-desktop, which doesn't sound fun at all. Alternatives? 回答1: No longer relevant. Installed the entire package, and got rsvg that way. 来源: https://stackoverflow.com/questions/787812/how-to-install-python-rsvg-without-python-gnome2-desktop-on-ubuntu-8-10

How to install python-rsvg without python-gnome2-desktop on Ubuntu 8.10?

瘦欲@ 提交于 2019-12-05 15:05:06
I need rsvg support in Python 2.5.2. It appears that I have to install all 199 deps along with the package python-gnome2-desktop, which doesn't sound fun at all. Alternatives? No longer relevant. Installed the entire package, and got rsvg that way. 来源: https://stackoverflow.com/questions/787812/how-to-install-python-rsvg-without-python-gnome2-desktop-on-ubuntu-8-10