Can anyone offer any pointers on how to achieve the following using vc++?
Any help would really be appreciated.
I am displaying two images on a dialog and I would like to save them into one file. Once they are in the file, I would like to add application "settings" into the file.
Afterwards, how can I retrieve and parse the data so I can display the images again?
I think I can use the code below to perform the first part but I get stuck with the second part of the process (loading and parsing the resulting file)
ifstream reader(fImagePath, ios::in | ios::binary);
ofstream writer(fileName, ios::app | ios::binary);
writer << reader.rdbuf();
Sounds like you'll have to define your own file format to do this. For example, you might use the first four bytes of the new file to store the size (in bytes) of the first image.
In other words, you need to have some way to specify where the first image ends and the other begins, unless you want to simply fuse the two images together, which would require some knowledge of the image file format.