Re: Creating a gif file from a visad display

  • To: Amaral <amaral@xxxxxx>
  • Subject: Re: Creating a gif file from a visad display
  • From: Tom Whittaker <tomw@xxxxxxxxxxxxx>
  • Date: Tue, 18 Mar 2003 08:24:22 -0600
As a footnote: Since Unisys holds a patent on the LZW encoding used in GIF images, if you are developing this software for commercial purposes, you would be required to secure a license from them in order to use GIF images (see: At least they are no longer going after _everyone_ who generates GIF images...but it's still another reason to use PNG.


Amaral wrote:
Please, I need help on the following problem. I would like to create a gif file from a visad display. I am using the code below but it does not work. Thanks for any help. Runnable captureImage = new Runnable() {
 public void run() {
 Image img = display.getImage();
 Graphics g =img.getGraphics();
g.drawImage(img, 0,0, null); try
File filee = new File("file.gif");
OutputStream output = new BufferedOutputStream(new FileOutputStream(filee));
GIFEncoder encoder = new GIFEncoder(img);
  catch (Exception w){ }
Thread t = new Thread(captureImage);

Tom Whittaker (tomw@xxxxxxxxxxxxx)
University of Wisconsin-Madison
Space Science and Engineering Center
Cooperative Institute for Meteorological Satellite Studies
Phone/VoiceMail: 608.262.2759