Enum LayerEffectsTypes

LayerEffectsTypes enumeration

Efek pencampuran lapisan.

public enum LayerEffectsTypes

Nilai

NamaNilaiKeterangan
DropShadow0Bayangan jatuh.
OuterGlow1Cahaya luar.
PatternOverlay2Hamparan pola.
GradientOverlay3Hamparan gradien.
ColorOverlay4Hamparan warna.
Satin5Jenis Efek Satin.
InnerGlow6Cahaya batin.
InnerShadow7Bayangan dalam.
Stroke8Pukulan.
BevelEmboss9Timbul bevel.

Contoh

Kode berikut menunjukkan dukungan properti ILayerEffect.EffectType.

[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)
        {
            // tertangkap
            psdImage.Save(outputWith, new PngOptions());
        }
    }
}

Lihat juga