[Gtk-sharp-list] How can I save a cairo imagesurface as a pixbuf
ajselvig at gmail.com
Wed Dec 24 16:05:01 EST 2008
Oops, trouble typing code into GMail. Let's finish...
Gtk.DrawingArea area = new Gtk.DrawingArea();
using (Context cr = Gdk.CairoHelper.Create(area.GdkWindow))
// draw the image with Cairo
Gdk.Pixbuf pixbuf = Gdk.Pixbuf.FromDrawable(area.GdkWindow,
I haven't used this exact method, but I don't see why it wouldn't work.
There also might be a better way that I'm not seeing.
On Wed, Dec 24, 2008 at 2:54 PM, Andy Selvig <ajselvig at gmail.com> wrote:
> Try creating a Gtk.DrawingArea, then use Gdk.CairoHelper to create a Cairo
> context to draw to. Then you can use Gdk.Pixbuf.FromDrawable to create the
> pixbuf. Something like:
> Gtk.DrawingArea area = new Gtk.DrawingArea();
> using (Context cr = Gdk.CairoHelper.Create(area.GdkWindow))
> On Mon, Dec 22, 2008 at 11:51 AM, alanb <alan.battersby at ntlworld.com>wrote:
>> I have a treeview and I want to store dynamically generated images in one
>> its columns. Reading the treeview tutorial I see that I need my image as
>> pixbuf. I am drawing the images using Cairo, all I can see in the
>> imagesurface API is to save as a png file directly with no access to its
>> underlying stream which I could use. So how can I convert a Cairo image to
>> If I use a Gdk.pixmap instead and draw to it, again how do I convert it to
>> View this message in context:
>> Sent from the Mono - Gtk# mailing list archive at Nabble.com.
>> Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gtk-sharp-list