如何将开罗图像表面的内容写入Gdk Pixbuf? [英] How to write contents of a Cairo Image surface into a Gdk Pixbuf?

查看:169
本文介绍了如何将开罗图像表面的内容写入Gdk Pixbuf?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个画布(Gdk绘图区域),我可以使用开罗绘制它,但我需要将画布的内容保存到缓冲区中,在我的情况下,它是一个Gdk Pixbuf。我想知道是否有可能,如果有更好的方式我想知道。

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.

谢谢。

推荐答案

我们使用简单的复制例程在f-spot中执行此操作。不是最优雅的解决方案,但它的工作原理:

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#170

这篇关于如何将开罗图像表面的内容写入Gdk Pixbuf?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆