• Post Reply Bookmark Topic Watch Topic
  • New Topic

Animations and Memory Usage

 
Don Gardner
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to create an animation of a series of 256 x 256 images. I've gotten the animation to work, but I am unble to load all of the necessary images for the animation (I cannot load much more than 100 images, but I need to display more than 3000). I get a java.lang.OutOfMemoryError.
Right now, I am loading my images as an array of ImageIcons, then displaying them using the paintIcon method.
Is there a more efficient way to store the images that would allow me to load such a large number of images?
Any suggestions would be greatly appreciated.
Thanks,
Don
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're going to need to load more than 3000 images to make an animation, I would look into the Java Media Framework. It allows the manipulation of actual video data. It's probably more efficiant to load 3000 frames of animation as a video stream than as 3000 separate images.
 
Don Gardner
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've played with the JMF a little bit, but only as far as loading and playing mpeg's and avi's. Do you have any suggestions as to which classes to look into for creating my one animations?
Also, do you have any idea if you can do image processing on individual frames of an animation created with the JMF?
Thanks for the advice! I'll look into the JMF.
Don
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!