[cairo] display a cairo_surface_t in gtk?

Kalle Vahlman kalle.vahlman at gmail.com
Tue Dec 26 08:14:09 PST 2006


2006/12/26, David L <idht4n at hotmail.com>:
> Hi,
>
> I'm using cairo to create a GdkPixmap that I display in a
> gtk drawing area.  I'd like to create a graphics file with the
> content of the pixmap when I click on the drawing area.  I
> know how to display a pixmap in a gtk drawing area using
> the GdkPixmap and I know how to create a graphics file
> from a cairo_surface_t, but I don't know how to both
> display a pixmap in gtk and create a graphics file from it
> without just creating two copies of the pixmap and using
> one for display and one for file creation.  Is there a way
> to do what I'm trying to do?

I think simply creating a cairo context with gdk_cairo_create() and
asking for the surface with cairo_get_target() should allow that.

-- 
Kalle Vahlman, zuh at iki.fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi


More information about the cairo mailing list