BlendingOptions class

BlendingOptions. It’s a wrapper for Lfx2Resource which provides api for layer effects

public class BlendingOptions


Name Description
Effects { get; } Gets the effects.


Name Description
AddColorOverlay() Adds the color overlay.
AddDropShadow() Adds the drop shadow effect.
AddGradientOverlay() Adds the Gradient overlay.
AddInnerShadow() Adds the inner shadow effect.
AddOuterGlow() Adds the outer glow effect.
AddPatternOverlay() Adds the Pattern overlay.
AddStroke(FillType) Adds the stroke effect.


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


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