[Mono-list] How can I copy one drawable into another?

Ian Norton inb at ncipher.com
Tue Nov 16 15:28:21 EST 2010


Hi Francisco,

If you have a png on disk, this is done like so:

void PaintImage( Context ctx, ImageSurface img, int x, int y ){
  img.Show( ctx, x, y );	
}
...
ImageSurface image = new ImageSurface( filename );
PaintImage( ctx, image, 10, 20 );

If you have a Gtk.Image and want to turn it into a Cairo ImageSurface
then you at the moment have to do something horrible like this:

Gtk.Image myImage;
...
Gdk.PixBuf buf = myImage.PixBuf;
buf.Save( "temp_convert","png" );
ImageSurface image = new ImageSurface ( "temp_convert" );

Regards

Ian


On Tue, 2010-11-16 at 19:29 +0000, Francisco M. Marzoa wrote:
> Hello,
> 
> I've a Gtk.Image widget with a given content and I just want to copy
> that content within a Gtk.DrawingArea, is this possible in an easy manner?
> 
> Thanks in advance,
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list




More information about the Mono-list mailing list