FillLayer.CreateInstance
Contents
[
Hide
]FillLayer.CreateInstance method
Build a new instance of the FillLayer
class by type of fill.
public static FillLayer CreateInstance(FillType fillType)
Parameter | Type | Description |
---|---|---|
fillType | FillType | The type of fill layer. |
Return Value
Returns a new instance of the FillLayer
class by type of fill.
Examples
The following example demonstrates how to add the FillLayer type layer at runtime.
[C#]
string outputFilePath = "output.psd";
using (var image = new PsdImage(100, 100))
{
FillLayer colorFillLayer = FillLayer.CreateInstance(FillType.Color);
colorFillLayer.DisplayName = "Color Fill Layer";
image.AddLayer(colorFillLayer);
FillLayer gradientFillLayer = FillLayer.CreateInstance(FillType.Gradient);
gradientFillLayer.DisplayName = "Gradient Fill Layer";
image.AddLayer(gradientFillLayer);
FillLayer patternFillLayer = FillLayer.CreateInstance(FillType.Pattern);
patternFillLayer.DisplayName = "Pattern Fill Layer";
patternFillLayer.Opacity = 50;
image.AddLayer(patternFillLayer);
image.Save(outputFilePath);
}
See Also
- enum FillType
- class FillLayer
- namespace Aspose.PSD.FileFormats.Psd.Layers.FillLayers
- assembly Aspose.PSD