SaveLayers example for Delphi
Var
i: Integer;
begin
// Save all the extra bitmaps in the bitmap list as layers
LEADImage1.SaveLayers:= True;
For i:= 1 to LEADImage1.BitmapListCount - 1 do
begin
// reset the layer info so all the layers are saved from 0,0 offset
LEADImage1.LayerLeft[i]:= 0;
LEADImage1.LayerTop[i] := 0;
LEADImage1.LayerBlendModeKey[i]:= 'dark';
LEADImage1.LayerClipping[i]:= 0;
LEADImage1.LayerOpacity[i] := 40;
LEADImage1.LayerMaskBitmap[i]:= 0;
end;
// set the active bitmap to be the first in the list
LEADImage1.Save ('c:\temp\layers.psd', FILE_PSD, 0, 0, SAVE_OVERWRITE);
end;