• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

animated gifs

 
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has anyone ever encountered this problem? I am working on a game that uses animated gifs that I created with Animation Shop. I load the images and register them with a Media Tracker when the main class is initialized. Then I waitForAll() so that the program will not do anything until all images have been loaded.
My problem is that when I add some of these gifs, the program hangs and will not do anything. If I comment them out, the program returns to working normally. I am not getting any errors from the Media Tracker during loading. Some of the gifs work and some don't. I thought at first it may have something to do with the size of the gif, but it does not. I have some larger ones (200KB) that work, and smaller ones (150KB) that do work. Does anyone have any ideas on this? Your help is greatly appreciated!!!
 
author
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've had this problem, but didn't bother resolving it - I just ditched the animated gifs. Here's a solution, however. The problem stems from the multiple frames that are included in an animated gif. Therefore, you need an image observer to make sure that all the frames get displayed. Fortunatly, this is easy if you want to use a swing component (ImageIcon), because it will use the imageObsever of the component you are drawing to (if it is capable of fulfilling that role of course). Try this,

I hope this helps
Sean

[This message has been edited by Sean MacLean (edited December 13, 2000).]
 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks! I will give this a try!
reply
    Bookmark Topic Watch Topic
  • New Topic