Re: GifEncoder example

Hi Andres,

> I`m tryng to save a visad display in gif format.  when i make:
> 
> Display d;
> ...
> d.getImage();
> 
> shows me an exception like:
> 
> Exception occurred during event dispatching:
> visad.VisADError: cannot call getImage() from Thread: AWT-EventQueue-0
>         at visad.DisplayImpl.getImage(DisplayImpl.java:1674)
>         at visad.DisplayImpl.getImage(DisplayImpl.java:1662)
>         at Formulario.Superficie2D.getImage(Superficie2D.java:125)
>         ...
> And i don`t know why.
> 
> can somebody send me an example?
> how can  i do this?

You are probably calling getImage() from an AWT callback.
You need to put the call, and the code that saves the result
as a GIF file, into its own Thread. See the captureDialog()
method around line 751 of visad/ss/FancySSCell.java for
an example of putting code into a Thread.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: