How to load images to an image array orderly?

I want to load an array of image, and I have 3 images named 0.png, 1.png and 2.png, if with processing, I can do like this way:

for(int i=0;i<3;i++)
imgarray[i] = loadImage(i+".png");

and it will load 0.png, 1 .png ,2.png to the image array imgarray[];

But in openframworks, how should I do ? I am not able to do this way :
for(int i=0;i<3;i++)

So what can I do ? thanks.

for (int i = 0; i< 3; i++)
imgarray[i].load(ofToString(i) + “.png”);

will work…maybe

1 Like

Yes!! it works!! thank you very much!