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 & HelpPrograms › how define PImage of array
Page Index Toggle Pages: 1
how define PImage of array (Read 1150 times)
how define PImage of array
Oct 17th, 2007, 7:12am
 
In the Processing, how define PImage of array?
Re: how define PImage of array
Reply #1 - Oct 17th, 2007, 7:49am
 
you can define arrays of almost anything. syntax is as follows:

"class or datatype name + []"

as in:

PImage[] imgs;
String[] manyStrings;
int[] nms;
...

for example:

loading 5 images named 0.jpg, 1.jpg, 2.jpg, ...

PImage[] moreImages = new PImage[5];
for ( int i = 0; i < moreImages.length; i++ )
{
moreImages[i] = loadImage( i+".jpg" );
}

loading 5 images with real names

PImage[] moreImages = new PImage[5];
moreImages[0] = loadImage( "myFirstImage.jpg" ); // zero-based, array starts at 0
moreImages[1] = loadImage( "another_one.jpg" );
moreImages[2] = loadImage( "yao.jpg" );
...

clear?
F
Re: how define PImage of array
Reply #2 - Oct 18th, 2007, 3:21am
 
I know,thanks.
Re: how define PImage of array
Reply #3 - Apr 7th, 2009, 7:19pm
 
hey, does anyone know how to store images in an array coming from a flickr feed?? let me know
0
Re: how define PImage of array
Reply #4 - Apr 7th, 2009, 10:59pm
 
Have you tried searching the forum (beware of the time limit, too short on the new forum!). I did and found starting out - displaying images from FlickR. Problem is that we also find lot of flickr in URLs too... You might want to check the option to show one result per thread.
HTH.
Page Index Toggle Pages: 1