Class InnerShadowEffect

InnerShadowEffect class

Inner Shadow Layer effect

public class InnerShadowEffect : IShadowEffect

Properties

NameDescription
Angle { get; set; }Gets or sets the angle in degrees.
BlendMode { get; set; }Gets or sets the blend mode.
Color { get; set; }Gets or sets the color.
Distance { get; set; }Gets or sets the distance in pixels.
EffectType { get; }Gets a type of effect
IsVisible { get; set; }Gets or sets a value indicating whether this instance is visible.
Noise { get; set; }Gets or sets the noise.
Opacity { get; set; }Gets or sets the opacity.
Size { get; set; }Gets or sets the blur value in pixels.
Spread { get; set; }Gets or sets the spread (choke) as percentage.
UseGlobalLight { get; set; }Gets or sets a value indicating whether [use this angle in all of the layer effects].

Methods

NameDescription
GetEffectBounds(Rectangle, int)Calculate and gets the bounds of effect pixels based on input layer pixels bounds.

Examples

The following code demonstrates how to change settings of the Inner Shadow Layer Effect.

[C#]

string sourceFile = "example.psd";
string outputFile = "sample_out.psd";

// Load an existing image into an instance of PsdImage class
var loadOptions = new PsdLoadOptions();
loadOptions.LoadEffectsResource = true;
using (var image = (PsdImage)Image.Load(sourceFile, loadOptions))
{
    var layer = image.Layers[image.Layers.Length - 1];
    var shadowEffect = (IShadowEffect)layer.BlendingOptions.Effects[0];

    shadowEffect.Color = Color.Green;
    shadowEffect.Opacity = 128;
    shadowEffect.Distance = 1;
    shadowEffect.UseGlobalLight = false;
    shadowEffect.Size = 2;
    shadowEffect.Angle = 45;
    shadowEffect.Spread = 50;
    shadowEffect.Noise = 5;

    image.Save(outputFile, new PsdOptions(image));
}

See Also