We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Loading lots of Images to array
Page Index Toggle Pages: 1
Loading lots of Images to array (Read 3209 times)
Loading lots of Images to array
Oct 15th, 2007, 6:24am
 
Hi all,

I'm trying to make a stop-motion animation by loading the images to an array and cycling through them.  I was wondering... if I have..say.. 200 images, is there a more efficient way to load them into an array then setting each image to its specified array location??  for example:

PImage[] images = new PImage[numFrames]; //image array

images[0] = loadImage("1.jpg");
images[1] = loadImage("2.jpg");
images[2] = loadImage("3.jpg");
images[3] = loadImage("4.jpg");  
etc etc etc


Also, after I made the animation, how might I save it in a video format?

Thanks a bunch~
Do Yon


Re: Loading lots of Images to array
Reply #1 - Oct 15th, 2007, 9:00am
 
Code:

PImage[] images = new PImage[12];
for ( int i = 0; i< images.length; i++ )
{
images[i] = loadImage( i + ".jpg" ); // make sure images "0.jpg" to "11.jpg" exist
}


F
Re: Loading lots of Images to array
Reply #2 - Oct 18th, 2007, 3:27am
 
Thanks!
Page Index Toggle Pages: 1