saving a tkinter canvas to gif

biner biner.sebastien at ouranos.ca
Wed Apr 14 14:27:18 EDT 2004


Hello,

  Is there any way to save a canvas created with tkinter to a gif (or
any other graphic) without using PIL (I cannot build it on our unix
machine)? For example with this simple code :
>>>
from Tkinter import *

root=Tk()
base=Canvas(root,width=50,height=50)
base.create_rectangle(0,0,50,25,fill='red')
base.create_rectangle(0,25,50,50,fill='blue')

base.pack()
root.mainloop()
<<<
How can I save the image with the two colored rectangle onto a graphic
file?
I looked on google and in the documentation but I didn't find how to
do it. Thanks for any help.

Sebastien.
biner.sebastien at ouranos.ca



More information about the Python-list mailing list