New to openframeworks here. I’m reading the documentation, and I see I can create an array of images but can’t seem to figure out if I can do that we directories or folders.
I have a series of photos all in different folders. When I tap or click, I would like to jump to the next folder to then access all images in the new folder and so own. So far I can load the directory DIR.listDir(“images/img/People”) and then iterate through it and put all images in an array.
I just don’t know how to do it for multiple folders.
you can do that with directories, it all depends on how you want to use them. Something I’ve done before is adding all of the paths to images into a vector, then you can load them whenever you want to an ofImage, or you can load all the images straight into a vector, all depends on your use case, ie if you are going to have 10 images and use them often, then for simplicity sake you could load them straight away, but if you were going to have 1000 and only see one at a time then you would save the paths and then load up the one you wanted to use.
if you were going to load up only a few images then you would use a for loop like here and then instead of “dir.getPath(i)” you would do:
as long as you have a vector<ofImage>images; declared.
that would then work for loading all of the images in that directory to the vector, then you could just repeat the process adding to the vector<ofImage>images; in another directory