Right, well as mentioned, there are not really any good ways to do this because of the lack of multi-frame layer formats.
At simplest you could do it by streaming:
// Save the layers of three TImageEnViews to a file
var
fs: TFileStream;
begin
fs := TFileStream.Create(FileName, fmCreate);
ImageEnView1.IO.SaveToStreamIEN( fs );
ImageEnView2.IO.SaveToStreamIEN( fs );
ImageEnView3.IO.SaveToStreamIEN( fs );
FreeAndNil(fs);
end;
// Load the layers
var
fs: TFileStream;
begin
fs := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite );
ImageEnView1.IO.LoadFromStreamIEN( fs );
ImageEnView2.IO.LoadFromStreamIEN( fs );
ImageEnView3.IO.LoadFromStreamIEN( fs );
FreeAndNil(fs);
end;
But obviously that is not a very practical solution.
Another way would be to save the files to temporary IEN files and then build a single file stream from all of them. Then when loading you could iterate through the stream until you find the image index you are looking for (which would be slow with large files). Also not a great solution.
If you are certain you want to go down this route, you should store each image+layers as IEN prefixed with its size (and maybe other metadata), so when loading you could skip ahead to the image you are looking for. This way you could also replace/insert new images.
[Image 0 Stream Size]
[Image 0 Stream]
[Image 1 Stream Size]
[Image 1 Stream]
[Image 2 Stream Size]
[Image 2 Stream]
...
However that would be a much more complex undertaking.
Nigel
Xequte Software
www.imageen.com