wxPython:从文件中绘制基于矢量的图像

时间:2021-06-17 07:11:52

How can I draw a vector-based image from a file in wxPython? I know nothing of image formats for such a thing, so please recommend.

如何从wxPython中的文件中绘制基于矢量的图像?我对这种事情的图像格式一无所知,所以请推荐。

2 个解决方案

#1


3  

You can do this with using cairo & librsvg python bindings. There is a small example here.

您可以使用cairo和librsvg python绑定来完成此操作。这里有一个小例子。

#2


1  

I have done something similar, I had a custom vector image format that I needed to render in a wxPython window. In order to accomplish this I used the GDI interface for drawing commands and I wrote my own parser module. There is a great GDI tutorial at this site that should help you out: http://www.zetcode.com/wxpython/gdi/

我做了类似的事情,我有一个自定义矢量图像格式,我需要在wxPython窗口中呈现。为了实现这一点,我使用GDI接口绘制命令,我编写了自己的解析器模块。这个站点有一个很棒的GDI教程可以帮助你:http://www.zetcode.com/wxpython/gdi/

#1


3  

You can do this with using cairo & librsvg python bindings. There is a small example here.

您可以使用cairo和librsvg python绑定来完成此操作。这里有一个小例子。

#2


1  

I have done something similar, I had a custom vector image format that I needed to render in a wxPython window. In order to accomplish this I used the GDI interface for drawing commands and I wrote my own parser module. There is a great GDI tutorial at this site that should help you out: http://www.zetcode.com/wxpython/gdi/

我做了类似的事情,我有一个自定义矢量图像格式,我需要在wxPython窗口中呈现。为了实现这一点,我使用GDI接口绘制命令,我编写了自己的解析器模块。这个站点有一个很棒的GDI教程可以帮助你:http://www.zetcode.com/wxpython/gdi/