ShapeLayer.CreateInstance
ShapeLayer.CreateInstance method
Creates a new instance of the ShapeLayer
class.
public static ShapeLayer CreateInstance()
Return Value
Returns the new instance of the ShapeLayer
class.
Examples
The following code shows support for the ShapeLayer layer.
[C#]
string srcFile = "ShapeLayerTest.psd";
string outFile = "ShapeLayerTest-out.psd";
using (PsdImage image = (PsdImage)Image.Load(srcFile, new PsdLoadOptions { LoadEffectsResource = true }))
{
ShapeLayer shapeLayer = (ShapeLayer)image.Layers[1];
IPath layerPath = shapeLayer.Path;
IPathShape[] pathShapeSource = layerPath.GetItems();
List<IPathShape> pathShapesDest = new List<IPathShape>(pathShapeSource);
// Source file contains 2 figures. Remove the seconds one.
pathShapesDest.RemoveAt(1);
layerPath.SetItems(pathShapesDest.ToArray());
shapeLayer.Update();
image.Save(outFile);
}
See Also
- class ShapeLayer
- namespace Aspose.PSD.FileFormats.Psd.Layers
- assembly Aspose.PSD