[pygtk] Copy a drawable to a cairo surface

Tobias Ceglarek dev at ceglarek.eu
Wed Aug 1 17:36:23 WST 2007


Thank you very much for this hint.

Meanwhile I have found a trick to solve my problem tolerably with
something like:

src_context = gtk.gdk.Drawable.cairo_create()
src_surface = src_context.get_target()
dst_surface = cairo.ImageSurface()
dst_context = cairo.Context(dst_surface)
dst_context.set_source_surface(src_surface);
dst_context.paint();
dst_surface.write_to_png()

Regards,

Tobias


On Tue, 2007-07-31 at 13:46 +0200, Gian Mario Tagliaretti wrote:
> 2007/7/30, Tobias Ceglarek <dev at ceglarek.eu>:
> 
> Hi Tobias,
> 
> > my task is to copy all I can see in a gtk.gdk.Drawable to a cairo
> > surface.
> 
> AFAIK is not yet possible, there is a huge patch in bugzilla for that:
> http://bugzilla.gnome.org/show_bug.cgi?id=offscreen
> 
> Unfortunately it cannot make it into GTK+ 2.12, it will probably be
> included in GTK+ 2.14
> 
> cheers



More information about the pygtk mailing list