saving a tkinter canvas to gif

Mickel Grönroos mickel at csc.fi
Thu Apr 15 01:57:43 EDT 2004


On Wed, 14 Apr 2004, biner wrote:

>   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)?

Have you tried the postscript method of Tkinter.Canvas?

> 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()

base.postscript("file.ps")

/Mickel

--
Mickel Grönroos, application specialist, linguistics, Research support, CSC
PL 405 (Tekniikantie 15 a D), 02101 Espoo, Finland, phone +358-9-4572237
CSC is the Finnish IT center for science, www.csc.fi




More information about the Python-list mailing list