Layers in Files
Certain files may contain layers. Currently, only PSD files support layers, although not all PSD files contain layers. Layers are numbered starting with 0. Therefore, the first layer in the file is layer 0. The next layer in the file is layer 1, etc. To load a layer from a file, call the LoadLayer method. Once the layer is loaded, the LayerLeft[0] and LayerTop[0] properties are updated with positioning information on the loaded layer.
The number of layers present in a file can be determined by calling the GetFileInfo method for a particular file. This method updates the InfoLayers property with the number of layers present in the file.
Each layer may have certain properties associated with it. These can be set or retrieved using the following properties:
Bitmaps may also be saved to a file as layers by setting the SaveLayers property to TRUE. If the SaveLayers property is set to TRUE, then the next time a PSD file is saved, all bitmaps are saved as layers. Prior to saving a PSD file, the LayerLeft[x] and LayerTop[x] properties can be set to contain the positioning information for each layer. When the PSD file is saved, this positioning information is used to save the layers.