requestImage doesnt work :(
in
Programming Questions
•
1 year ago
hi...i am trying to load a set of images within a loop in processing as well as procesing.js
The loadImage works well in processing but requestImage doesnt and using a preload directive is not feasible.
Please find the code below:
PImage[] images = new PImage[36];
void setup()
{
size(500,500);
background(0);
for ( int i = 0; i< images.length; i++)
{ String s="";
if(str(i).length()==1)
s="000"+str(i);
else if(str(i).length()==2)
s="00"+str(i);
images[i] = requestImage("Projection of ResultJPGs"+ s +".jpg" );
println(images[i].width); //shows 0 upon usin requestImage
}
}
Any help is highly appreciated!
1