Hello,
I am using following code to load .PSD files in ImageEnView.
MainForm.ImageEnViewMain.LayersClear;
MainForm.ImageEnViewMain.Blank;
MainForm.ImageEnViewMain.MouseInteract := [];
MainForm.ImageEnViewMain.Update;
//============= Load user selected File
if FileExists(fName) then
begin
MainForm.ImageEnViewMain.IO.Params.PSD_LoadLayers := True;
MainForm.ImageEnViewMain.IO.LoadFromFilePSD(fName);
MainForm.ImageEnViewMain.MouseInteract := [miMoveLayers, miResizeLayers];
MainForm.ImageEnViewMain.Layers[0].Locked := True;
MainForm.ImageEnViewMain.Update;
end
else
begin
ShowMessage('Cannot Open "PSD" File');
exit;
end;
But on executing this code the file is loaded but what we see is a blank ImageEnView. And I have observed that there is an extra layer (0th layer) in the file loaded. So for example if the original .PSD file has 20 layers when loaded in ImageEnView there will be one extra layer added to it. Why?
Currently as a work around what I am doing is loading .PSD file twice! First loading the PSD with the Param - PSD_LoadLayers set to False and then reloading the file again immediately by setting this parameter to True. But this workaround is taking very long time to load the files this is noticeable when a user loads very large (around 150 MB) .PSD files.
Here is the work around code:
MainForm.ImageEnViewMain.IO.Params.PSD_LoadLayers := False;
MainForm.ImageEnViewMain.IO.LoadFromFilePSD(fName);
MainForm.ImageEnViewMain.IO.Params.PSD_LoadLayers := True;
MainForm.ImageEnViewMain.IO.LoadFromFilePSD(fName);
TIA
Yogi Yang