Support of Fill Layers

Fill Layers With Pattern Fill

This article demonstrates how to fill the PSD layer with the Pattern fill. A Pattern* *is an image, color, shadow or line that is used to fill an area of an image. Please use the Aspose.PSD.FileFormats.Psd.Layers.FillLayer to add Pattern in the PSD layer. The following code snippets load a PSD file, access the Filllayer class and sets the Pattern using the PatternFillSettings properties.

Here is another example which demonstrates how Aspose.PSD renders the pattern by using FillLayer and IPatternFillSettings .

Fill Layers With Gradient Fill

This article demonstrates the usage of Gradient fill to fill the PSD layer. Aspose.PSD APIs have exposed efficient & easy to use methods to achieve this goal. Aspose.PSD has exposed the GradientColorPoint and GradientTransparencyPoint classes to add a Gradient effect into a layer.

 The steps to fill the PSD layer with a Gradient fill are as simple as below:

  • Load a PSD file as an image using the factory method Load exposed by Image class.
  • Set settings properties of FillLayer object.
  • Create a list of ColorPoints with required colors and positions of color.
  • Create a list of transparency points with required opacity and position of transparency point.
  • Call the FillLayer.Update method
  • Save the results.

The following code snippet shows you how to add Gradient fill to fill PSD layer.

Here is another example which uses a GradientFillSettings.GradientType** **property to fill PSD layer with Gradient fill. Aspose.PSD supports the following gradient types through the GradientType enumeration:

  • GradientType.Linear:       In a linear gradient, the color transitions from the starting hue to end in a straight line.**
  • GradientType.Radial:       In a radial gradient, the colors fan out from the starting point in a circular pattern.
  • GradientType.Angle:        An angle gradient sweeps counterclockwise around the starting point.
  • GradientType.Reflected: In a reflected gradient, the color is mirrored on both sides of the starting point.
  • GradientType.Diamond:   Diamond gradient creates a diamond shape from the starting point.

Support of Scale Property for Gradient Fill Layer

This article demonstrates how to scale FillLayer with gradient fill using Aspose.PSD for .NET. For this purpose, a new property Scale has been added in IGradientFillSettings.

Following is the code demonstration that shows how to use Scale property.

Fill Layers With Color Fill

This article demonstrates how to fill PSD layer with Color. Please use the Psd.Layers.FillLayer class to add Color in PSD layer. The following code snippet loads a PSD file, access the Fill layer class and sets the color using the FillLayer.FillSettings property.