Re: [pygtk] gtk.gdk.Image from a gtk.Image

2003-02-04 Thread James Henstridge
Pablo Endres wrote:


	How do I obtain a gtk.gdk.Image??

	I'm trying to paint an image on a Drawing Area with DA.draw_image
	I can't use a gtk.Image.  Any ideas on another way of painting it or to obtain this object?

	I checked the FAQ and the tutorial. Int the first there is nothing usefull and in the second the
	method is for pygtk 0.6.x.
 

A gtk.gdk.Image is a client side raster image.  A gtk.Image widget is 
used to display raster images from a number of formats (a gtk.gdk.Image, 
a gtk.gdk.Pixmap, a gtk.gdk.Pixbuf, a stock icon, or an image file).  So 
your question doesn't quite make sense.

If you want to load an image file and draw it to a gtk.DrawingArea, I 
suggest creating a gtk.gdk.Pixbuf object, and rendering it to the 
drawable.  Something like this:
   pixbuf = gtk.gdk.pixbuf_new_from_file('filename.png')
   pixbuf.render_to_drawable(drawingarea.window, gc, src_x, src_y, 
dest_x, dest_y, width, height, gtk.gdk.RGB_DITHER_NORMAL, 0, 0)

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] gtk.gdk.Image from a gtk.Image

2003-02-03 Thread Pablo Endres

How do I obtain a gtk.gdk.Image??

I'm trying to paint an image on a Drawing Area with DA.draw_image
I can't use a gtk.Image.  Any ideas on another way of painting it or to obtain 
this object?

I checked the FAQ and the tutorial. Int the first there is nothing usefull and 
in the second the
method is for pygtk 0.6.x.

Thanks in advance

They that can give up essential liberty to obtain a little 
temporary safety deserve neither liberty nor safety.
 -- Benjamin Franklin, 1759

Pablo Endres
Centro de Datos

GSM:  +584127347610
Off:  +584128085690

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/