InfoLayers example for C++ Builder
int i;
// This example all the layers in a file to a bitmap list
LEADImage1->GetFileInfo ( "c:\\temp\\layers.psd", 0);
if (!LEADImage1->InfoLayers )
ShowMessage ( "This file has no layers!" );
else
{
// 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; i < LEADImage1->InfoLayers; i ++ )
{
// 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);
}
}