Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: saving a tkinter canvas

Reply
Thread Tools

Re: saving a tkinter canvas

 
 
=?ISO-8859-1?Q?Mickel_Gr=F6nroos?=
Guest
Posts: n/a
 
      04-01-2004
On Wed, 31 Mar 2004, Elaine Jackson wrote:

> Newbie. Playing with the 'turtle' module and wondering if there's a way to save
> the graphics you make with it. The documentation itself has nothing to say about
> this, nor (as far as I can tell) does the FAQ list at python-dot-org. Any
> pointers would be very much appreciated.


You can save Tkinter.Canvases as PostScript using the
Tkinter.Canvas.postscript() method.

>>> import Tkinter
>>> root = Tkinter.Tk()
>>> canvas = Tkinter.Canvas(root)
>>> canvas.pack()
>>> rect = canvas.create_rectangle(10,10,100,100, fill="blue")
>>> retval = canvas.postscript(file="saved.ps", height=100, width=100, colormode="color")
>>>


/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




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to couper contenier of a canvas in an outer canvas??? olsr.kamal@gmail.com Python 10 03-15-2013 08:46 PM
Canvas with scrollbars - how to get correct canvas coordinate when the scroll bars have moved? PhilC Python 2 10-25-2004 11:57 AM
Canvas scrolling - scrollBar become "disabled" on change in canvas Askari Python 2 08-30-2004 02:56 PM
saving a tkinter canvas to gif biner Python 2 04-16-2004 05:33 AM
Saving a Canvas as other than PS Reid Nichol Python 0 04-15-2004 05:50 AM



Advertisments