InfoLayers example for Delphi
var
i: Integer;
begin
// This example all the layers in a file to a bitmap list
LEADImage1.GetFileInfo ( 'c:\temp\layers.psd', 0);
if LEADImage1.InfoLayers = 0 then
ShowMessage ( 'This file has no layers!' )
else
begin
// load the first layer directly
LEADImage1.LoadLayer ('c:\temp\layers.psd', 0, 0);
// steal the bitmaps from the other control
LEADImage1.RefBitmap:= True;
for i:= 1 to LEADImage1.InfoLayers - 1 do
begin
// use a second control to load the other layers
// using LEADImage1 to load the other layers would invalidate the bitmap list
LEADImage2.LoadLayer ('c:\temp\layers.psd', 0, i );
// append the layer to the bitmap list
LEADImage1.InsertBitmapListItem (LST_APPEND, LEADImage2.Bitmap);
end;
end;
end;