Re: saving lines on canvas as GIF file format



Andy Cho wrote:
Could anyone let me know way how I can save lines on canvas as GIF
image file.

The easiest way I know of is this series of steps:
1. Make a BufferedImage of the correct size.
2. Tell the canvas to paint to the image
3. Use ImageIO to save the image to a GIF file.

--
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
.



Relevant Pages

  • How to trigger two events with 2 document.locations?
    ... The page has a canvas and a form. ... image file and send the form for process upon SAVE. ... function handleCanvas() { ... var oCanvas = ... ...
    (comp.lang.javascript)
  • Re: saving lines on canvas as GIF file format
    ... image file. ... Tell the canvas to paint to the image ... Use ImageIO to save the image to a GIF file. ...
    (comp.lang.java.programmer)
  • Re: saving lines on canvas as GIF file format
    ... Could anyone let me know way how I can save lines on canvas as GIF ... image file. ... http://thecovemovie.com: The Cove: a documentary about Japan's secret atrocities against dolphins. ...
    (comp.lang.java.programmer)
  • Re: Canvas to image file (jpeg)
    ... Jeannot wrote: ... > I have a tcl/tk program which output is canvas with simple drawn element ... > So my first idea was to generate an image file from the canvas and so my ... > Best regards, ...
    (comp.lang.tcl)
  • Canvas to image file (jpeg)
    ... I have a tcl/tk program which output is canvas with simple drawn element ... such as lines, rectangles and text ... ... So my first idea was to generate an image file from the canvas and so my ... first question is: ...
    (comp.lang.tcl)