load svg with Cairo

╄→гoц情女王★ 提交于 2019-12-06 03:41:38

问题


I want to load a SVG file with the Cairo library, do apply some transformations to it. Then I want to display my svg with a glTexture.

But I just find functions which create svg file and not load svg.


回答1:


Cairo itself cannot read SVG files. You need something like librsvg to render SVGs to a Cairo surface.

From a quick look at their API documentation, it looks like you need rsvg_handle_new_from_file() to load a file and something like rsvg_handle_render_cairo() or rsvg_handle_get_pixbuf() to draw the SVG to a Cairo context / to turn the SVG into a GdkPixbuf.



来源:https://stackoverflow.com/questions/21152068/load-svg-with-cairo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!