By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,534 Members | 1,322 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,534 IT Pros & Developers. It's quick & easy.

saving a tkinter canvas

P: n/a
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.

(In related news, I would also like to find out what's going on with "bounding
boxes" in image files - not having them is keeping me from including images in
latex files.)

Peace
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Wed, 31 Mar 2004, Elaine Jackson wrote:
Newbie. Playing with the 'turtle' module and wondering if there's a wayto 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


Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.