[pygtk] gtk.Image write text inside Image‏

Luis Gonzalez ghempresa at hotmail.com
Sun Nov 9 17:58:31 WST 2008


Hi ,

>>If however you are using PyGTK anyway or are also going to use the 
>>image within PyGTK, the basic procedure is:
>>
>>- load a pixbuf with the image from a file using 
>>gtk.gdk.pixbuf_new_from_file()
>>- create a pixmap of the same size using gtk.gdk.Pixmap() or 
>>gtk.gdk.Pixbuf.render_pixmap_and_mask()
>>- draw the pixbuf image on the pixmap using 
>>gtk.gdk.Drawable.draw_pixbuf() (not needed if render_pixmap_and_mask was 
>>used)
>>- draw your text, lines, etc. in the pixmap using either the cairo or 
>>gtk methods
>>- transfer the pixmap to the pixbuf using gtk.gdk.Pixbuf.get_from_drawable()
>>- write out the image using gtk.gdk.Pixbuf.save()
I try to do this code , but i can't get it work so i would try PIL , Can i use PIL in an GPL python project?


Thanks

_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx


More information about the pygtk mailing list