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/