小编m.a*_*aa8的帖子

在python中从SVG源绘制GTK3中的SVG图像

我可以在PyQt中轻松完成这样的操作:

img = '''<?xml version="1.0" encoding="UTF-8"?>
<svg width="50" height="50" xmlns="http://www.w3.org/2000/svg">
 <!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
 <g>
  <title>Layer 1</title>
   <circle stroke-width="3" stroke="#1a1a1a" fill="#dfdbd2" r="16" cy="25" cx="25"/>
   <path stroke-width="0" fill="#1a1a1a" d="m25,9a16,16 0 0 0 0,32l0,-1.5a18,18 0 0 0 0,-29l0,-1.5z"/>
 </g>
</svg>'''
image = QtCore.QByteArray(img)
self.svgwidget.load(image)
Run Code Online (Sandbox Code Playgroud)

我怎么能在Gtk中这样做?有任何想法吗?:) 提前致谢!

python gtk svg

5
推荐指数
2
解决办法
2630
查看次数

标签 统计

gtk ×1

python ×1

svg ×1