How to write contents of a Cairo Image surface into a Gdk Pixbuf?

泪湿孤枕 提交于 2019-12-11 07:29:03

问题


I have a canvas(Gdk Drawing Area), which I can draw into it using Cairo, but I need to save contents of my canvas into a buffer which in my case is a Gdk Pixbuf. I want to know if it's possible or not, if there is a better way I would like to know.

thanks.


回答1:


We do this in f-spot using a simple copy routine. Not the most elegant solution, but it works:

http://git.gnome.org/browse/f-spot/tree/lib/libfspot/f-pixbuf-utils.c#n170



来源:https://stackoverflow.com/questions/4291994/how-to-write-contents-of-a-cairo-image-surface-into-a-gdk-pixbuf

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