You can replace the layers automatically by setting ImageEnView1.IO.Params.PSD_ReplaceLayers to true before loading the file. If PSD_LoadLayers is True then the layers in the PSD file replace any layers already in ImageEnView. If PSD_ReplaceLayers is False then all layers in the PSD file will be added to the layers in ImageEnView. When PSD_ReplaceLayers is True, the content of the PSD file replaces the content of the ImageEnView.
So Normal loading is:
ImageEnView1.IO.Params.PSD_LoadLayers := True;
ImageEnView1.IO.Params.PSD_ReplaceLayers := True;
ImageEnView1.IO.LoadFromFilePSD(AFilename);
To Add all layers:
ImageEnView1.IO.Params.PSD_LoadLayers := True;
ImageEnView1.IO.Params.PSD_ReplaceLayers := False;
ImageEnView1.IO.LoadFromFilePSD(AFilename);
So to test:
1. Load first PSD file with:
if iFileType = ioPSD then
begin
ImageEnView1.IO.Params.PSD_LoadLayers := True;
ImageEnView1.IO.Params.PSD_ReplaceLayers := True;
ImageEnView1.IO.LoadFromFile(iFilePath);
end;
2. Load the second PSD file with
if iFileType = ioPSD then
begin
ImageEnView1.IO.Params.PSD_LoadLayers := True;
ImageEnView1.IO.Params.PSD_ReplaceLayers := False;
ImageEnView1.IO.LoadFromFilePSD(AFilename);
end;
William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html