exporting from Tkinter Canvas object in PNG

harold fellermann harold.fellermann at upf.edu
Tue Jan 11 13:36:53 EST 2005


On 11.01.2005, at 19:14, Nicolas Pourcelot wrote:

> Hello,
> I'm new to this mailing list and quite to Pyhon too.
> I would like to know how to export the contain of the Canvas object
> (Tkinter) in a PNG file ?
> Thanks :)
> Nicolas Pourcelot
> -- 
> http://mail.python.org/mailman/listinfo/python-list

you can make a postscript dump using

 >>> canvas = Tkinter.Canvas(master)
 >>> canvas.postscript(file="your_file_name.ps")

If you have ImageMagick, you can later use

% convert your_file_name.ps your_file_name.png

on the comand line, if you want to have png.


- harold -

--
Science is to see what everybody else has seen,
and think what nobody else has thought.
--




More information about the Python-list mailing list