Visual Basic (Declaration) | |
---|---|
Public Function LoadPsdLayer( _ ByVal fileName As String, _ ByVal bitsPerPixel As Integer, _ ByVal order As CodecsLoadByteOrder, _ ByVal layer As Integer, _ ByVal layerInfo As CodecsPsdLayerInfo _ ) As RasterImage |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public RasterImage LoadPsdLayer( string fileName, int bitsPerPixel, CodecsLoadByteOrder order, int layer, CodecsPsdLayerInfo layerInfo ) |
C++/CLI | |
---|---|
public: RasterImage LoadPsdLayer( String^ fileName, int bitsPerPixel, CodecsLoadByteOrder order, int layer, CodecsPsdLayerInfo^ layerInfo ) |
Parameters
- fileName
- A String containing the name of the image file to load.
- bitsPerPixel
Resulting image pixel depth. Valid values are:
Value Meaning 0 Keep the original file's pixel depth (Do not convert). 1 to 8 The specified bits per pixel in the resulting image. 12 12 bits per pixel in the resulting image. 16 16 bits per pixel in the resulting image. 24 24 bits per pixel in the resulting image. 32 32 bits per pixel in the resulting image. 48 48 bits per pixel in the resulting image. 64 64 bits per pixel in the resulting image. - order
- The desired color order.
- layer
- Index of the layer to load. This index is zero-based. Pass 0 to load the first layer, 1 to load the second layer, etc.
- layerInfo
- a CodecsPsdLayerInfo object to be updated with information about the loaded layer. Pass a null reference (Nothing in Visual Basic) for this parameter if layer information is not needed.
Return Value
The RasterImage object that this method loads.This example will create and save a PSD with layers before re-loading the first layer back
Visual Basic | Copy Code |
---|---|
Public Sub PsdLayersExample() |
C# | Copy Code |
---|---|
public void PsdLayersExample() |
Use this method to load PSD files only.
This method works similarly to a normal RasterCodecs.Load(String) method, except that it loads only a layer from a PSD file. It loads the layer specified in layer.
Before calling this method, you may need to get or set file information, such as the number of layers on the file. Refer to CodecsPsdImageInfo.
The number of layers in a file is indicated in CodecsPsdImageInfo.Layers. If this number is 0, the file does not contains any layers and this method should not be called.
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family