简体   繁体   English

如何使用svgwrite导入现有的svg-Python

[英]How to import an existing svg with svgwrite - Python

I need to import an existing svg picture and add elements like circle and square on it. 我需要导入现有的svg图片,并在其上添加诸如圆形和正方形的元素。 My file is 'test.svg' so i tryed 我的文件是“ test.svg”,所以我尝试了
dwg = svgwrite.Drawing('test.svg')
but it create a new svg file without anything. 但它会创建一个没有任何内容的新svg文件。 I use the python lib svgwrite, do you have any idea for me? 我使用python lib svgwrite,对我有什么想法吗?
Thank you, and sorry for my english... I do my best! 谢谢,对不起我的英语...我会尽力!

svgwrite will only create svg files. svgwrite将仅创建svg文件。 svgwrite does not read svg files. svgwrite不读取svg文件。 If you want to read, modify and then write the svg, the svgwrite package is not the package to use but I do not know of an appropriate package for you. 如果您想阅读,修改和编写svg,则svgwrite软件包不是要使用的软件包,但我不知道适合您的软件包。

It might be possible to create svg which uses a reference to another image. 可以创建使用对另一个图像的引用的svg。 That is there is one svg which you then put a second svg on top of the first. 那是一个svg,然后您将第二个svg放在第一个之上。 I have not done this and do not know if it would actually work. 我还没有这样做,也不知道它是否真的可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM