On 2008.11.07 15:21:29 +0000, Luis Gonzalez wrote: > I have a gtk.Image load from file. > > I want to write text inside this Image and then write to a file (jpg or png). > > I try to do use gtk.gdk.Pixbuf but to write text , draw lines , draw > rectangle I need a drawable object like gtk.gdk.Pixmap. > > How can i do this?
The last time I needed to do this (in 2005), I had problems with PyGTK's image manipulation abilities / API / docs, and ended up using Python Imaging Library from inside my PyGTK program. I have some code PyGTK + PIL code that you can look at here: http://slugathon.python-hosting.com/file/trunk/slugathon/Chit.py It loads a base image from a PNG file into PIL, then uses PIL to draw lines and text on it, then takes the final image and saves it to a file format that PyGTK understands (via a StringIO, though you could use a real file instead), so that PyGTK can load it into a pixbuf. PyGTK gets better every release, and its docs have improved too, so maybe it's no longer necessary to resort to PIL. But it's an option to consider. -- David Ripton [EMAIL PROTECTED] _______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
