saving a tkinter canvas

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Elaine Jackson

    saving a tkinter canvas

    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


  • Mickel Grönroos

    #2
    Re: saving a tkinter canvas

    On Wed, 31 Mar 2004, Elaine Jackson wrote:
    [color=blue]
    > 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.[/color]

    You can save Tkinter.Canvase s as PostScript using the
    Tkinter.Canvas. postscript() method.
    [color=blue][color=green][color=darkred]
    >>> import Tkinter
    >>> root = Tkinter.Tk()
    >>> canvas = Tkinter.Canvas( root)
    >>> canvas.pack()
    >>> rect = canvas.create_r ectangle(10,10, 100,100, fill="blue")
    >>> retval = canvas.postscri pt(file="saved. ps", height=100, width=100, colormode="colo r")
    >>>[/color][/color][/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




    Comment

    Working...