ImageEn, unit iexBitmaps

TIOParams.PSD_LoadLayers

TIOParams.PSD_LoadLayers


Declaration

property PSD_LoadLayers: Boolean;


Description

When enabled, ImageEn will load the separated layers of a PSD file. If False, only the merged image is loaded (flattened layers).

Default: False (Specified by IOParamDefaults)


About Adobe PhotoShop Layers

PSD files are unique among the file types supported by ImageEnIO because the file stores layer information inside of the file including layer positions, layer names, layer dimensions and other unique information along with a merged image containing all the layers flattened onto a background.

When opening PSD files with ImageEnIO the layers can be loaded automatically by setting ImageEnView1.IO.Params.PSD_LoadLayers to true (before loading). If PSD_LoadLayers is True then the merged image is ignored and only the layers are loaded. If PSD_LoadLayers is False then only the merged image is loaded.

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. For example, assume a PSD file has three layers, and ImageEnView has two layers. This is the situation before loading the PSD file:

ImageEnView, Layer 0: image X
ImageEnView, Layer 1: image Y

Now, you load the PSD file with PSD_ReplaceLayers = True: The result will be:
ImageEnView, Layer 0 : PSD layer 0
ImageEnView, Layer 1 : PSD layer 1
ImageEnView, Layer 2 : PSD layer 2

If PSD_ReplaceLayers was False, the result will be:
ImageEnView, Layer 0: image X
ImageEnView, Layer 1: image Y
ImageEnView, Layer 2 : PSD layer 0
ImageEnView, Layer 3 : PSD layer 1
ImageEnView, Layer 4 : PSD layer 2

ImageEn usually has a Layer 0 so when you load a PSD file, PSD_LoadLayers should be True and PSD_ReplaceLayers should be True:
ImageEnView1.IO.Params.PSD_LoadLayers := True;
ImageEnView1.IO.Params.PSD_ReplaceLayers := True;
ImageEnView1.IO.LoadFromFilePSD(Filename);

If both PSD_LoadLayers and PSD_ReplaceLayers is true then the layers displayed by ImageEnView after the file is loaded will be the same as the layers that are in the PSD file. Generally, both of these params should be set to true before opening a PSD file.
If you do not set PSD_ReplaceLayers to True before loading the PSD file, ImageEnView will contain an empty layer 0 after the PSD file is opened.

Note: All layers are loaded as image layers, i.e. text and other type layers will become image layers


Example

// loads a multilayer PSD and allow user to move and resize layers
ImageEnView1.IO.Params.PSD_LoadLayers := True;
ImageEnView1.IO.LoadFromFile('C:\input.psd');
ImageEnView1.MouseInteractLayers := [mlMoveLayers, mlResizeLayers];


See Also

 PSD_ReplaceLayers