save images from a given folder to a vector

Hi, I'm having an issue with a program I'm trying to write. The program's function is to take a user selected image and create a mosaic from other images in a particular folder. The function I am have trouble with is the one required to save each image to a vector from the folder. The folder is provided through the GUI. I'm confused on how exactly to do this. How can I load each image from the folder and save them to the global vector? I'm fairly new to c++. If you need other code let me know.
1
2
3
4
5
6
7
8
//globals
image myImage1;
vector <fillerImage> myFillers;
bool loadFillerImagesFromFolder(string folder) {
    ifstream inFile; // declare in file stream variable
    
    return false;
}

Thank you
Last edited on
I really need some help with this. I know it has to be a simple answer, I just can't figure it out haha
Richard Evans wrote:
I know it has to be a simple answer, I just can't figure it out
Hint: you can't figure it out because it is not a simple answer. It's extremely complex. I suggest using an image manipulation library. ;)
Check out SFML. The Graphics library contains an "image" class that loads an image from memory and prepares it for display in a window. Even if you don't use the class yourself, the source code is available if you want to figure out how they did it.

http://www.sfml-dev.org/tutorials/1.6/graphics-sprite.php
Well I know how to load an individual image from a file and then displaying it in a QT window. The problem I'm having is loading around 900 images from a given folder into a data structure. I need the function to search through the folder and load each image it finds into the data structure. Thanks for your help I'll check those out.
Topic archived. No new replies allowed.