FillLayer.CreateInstance
FillLayer.CreateInstance method
Bangun instance baru dariFillLayer
kelas berdasarkan jenis isian.
public static FillLayer CreateInstance(FillType fillType)
Parameter | Jenis | Keterangan |
---|---|---|
fillType | FillType | Jenis lapisan pengisi. |
Nilai Pengembalian
Mengembalikan instance baru dariFillLayer
kelas berdasarkan jenis isian.
Contoh
Contoh berikut menunjukkan cara menambahkan lapisan tipe FillLayer saat runtime.
[C#]
string outputFilePath = "output.psd";
using (var image = new PsdImage(100, 100))
{
FillLayer colorFillLayer = FillLayer.CreateInstance(FillType.Color);
colorFillLayer.DisplayName = "Color Fill Layer";
image.AddLayer(colorFillLayer);
FillLayer gradientFillLayer = FillLayer.CreateInstance(FillType.Gradient);
gradientFillLayer.DisplayName = "Gradient Fill Layer";
image.AddLayer(gradientFillLayer);
FillLayer patternFillLayer = FillLayer.CreateInstance(FillType.Pattern);
patternFillLayer.DisplayName = "Pattern Fill Layer";
patternFillLayer.Opacity = 50;
image.AddLayer(patternFillLayer);
image.Save(outputFilePath);
}
Lihat juga
- enum FillType
- class FillLayer
- ruang nama Aspose.PSD.FileFormats.Psd.Layers.FillLayers
- perakitan Aspose.PSD