DropShadowEffect.EffectType
Contents
[
Hide
]DropShadowEffect.EffectType property
Gets a type of effect
public LayerEffectsTypes EffectType { get; }
Examples
The following code demonstrates using the Opacity property of DropShadowEffect.
[C#]
string inputFile = "input.psd";
string outputImage20 = "outputImage20.png";
string outputImage200 = "outputImage200.png";
using (PsdImage psdImage = (PsdImage)Image.Load(inputFile, new LoadOptions()))
{
Layer workLayer = psdImage.Layers[1];
DropShadowEffect dropShadowEffect = workLayer.BlendingOptions.AddDropShadow();
dropShadowEffect.Distance = 0;
dropShadowEffect.Size = 8;
// Example with Opacity = 20
dropShadowEffect.Opacity = 20;
psdImage.Save(outputImage20, new PngOptions());
// Example with Opacity = 200
dropShadowEffect.Opacity = 200;
psdImage.Save(outputImage200, new PngOptions());
}
The following code demonstrates support of ILayerEffect.EffectType property.
[C#]
string inputFile = "input.psd";
string outputWithout = "outputWithout.png";
string outputWith = "outputWith.png";
using (PsdImage psdImage = (PsdImage)Image.Load(inputFile, new LoadOptions()))
{
psdImage.Save(outputWithout, new PngOptions());
Layer workLayer = psdImage.Layers[1];
DropShadowEffect dropShadowEffect = workLayer.BlendingOptions.AddDropShadow();
dropShadowEffect.Distance = 0;
dropShadowEffect.Size = 8;
dropShadowEffect.Opacity = 20;
foreach (ILayerEffect iEffect in workLayer.BlendingOptions.Effects)
{
if (iEffect.EffectType == LayerEffectsTypes.DropShadow)
{
// it caught
psdImage.Save(outputWith, new PngOptions());
}
}
}
See Also
- enum LayerEffectsTypes
- class DropShadowEffect
- namespace Aspose.PSD.FileFormats.Psd.Layers.LayerEffects
- assembly Aspose.PSD