[cairo] cairo_surface_t to GdkPixbuf conversion

zaheer ahmad zaheer.mot at gmail.com
Mon Oct 20 03:18:19 PDT 2008


Hi,
Thanks for the quick response. I tried the api gdk_pixbuf_get_from_drawable(
however it does not seem to work with a cairo_surface_t, is cairo_surface_t
a GdkDrawable i think its not?

cairo_sur = cairo_surface_create_for_image(...)

GdkPixbuf *pix  = gdk_pixbuf_get_from_drawable(NULL,
(GdkDrawable*)cairo_sur, 0,0,0,0, width, height);
returns empty.

Let me know if somethings wrong above.

I see a patch that does this (surface_to_pixbuf)
http://lists.ximian.com/pipermail/mono-patches/2008-March/113079.html
will try and let u know..


thanks,
Zaheer


On Mon, Oct 20, 2008 at 12:31 PM, Sven Herzberg <herzi-ml at gnome-de.org>wrote:

> Am Montag, den 20.10.2008, 12:26 +0530 schrieb zaheer ahmad:
> > hi,
> > I would like to convert a cairo_surface_t to GdkPixbuf. There seems to
> > be no straight forward apis to do that. looking for some inputs.
>
> gdk_pixmap_new()
> gdk_cairo_create()
> cairo_set_source_surface()
> cairo_paint()
> cairo_destroy()
> gdk_pixbuf_get_from_drawable()
>
> Like this?
>
> Regards,
>   Sven
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20081020/5a526209/attachment.html 


More information about the cairo mailing list