Stroke Effect With Color Fill

색 채우기 스트로크 효과

이 문서에서는 색 채우기 스트로크 효과를 렌더하는 방법을 보여줍니다. 스트로크 효과는 레이어 및 모양에 테두리 및 외곽선을 추가하는 데 사용됩니다. 이를 사용하여 단색 선, 다채로운 그라데이션, 그리고 패턴이 있는 테두리를 만들 수 있습니다.

색 채우기 스트로크 효과를 렌더하는 단계는 다음과 같습니다:

다음 코드 스니펫은 색 채우기 스트로크 효과를 렌더하는 방법을 보여줍니다.

// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_PSD();
// Implement rendering of Stroke effect with Color Fill for export
string sourceFileName = dataDir + "StrokeComplex.psd";
string exportPath = dataDir + "StrokeComplexRendering.psd";
string exportPathPng = dataDir + "StrokeComplexRendering.png";
var loadOptions = new PsdLoadOptions()
{
LoadEffectsResource = true
};
using (var im = (PsdImage)Image.Load(sourceFileName, loadOptions))
{
for (int i = 0; i < im.Layers.Length; i++)
{
var effect = (StrokeEffect)im.Layers[i].BlendingOptions.Effects[0];
var settings = (ColorFillSettings)effect.FillSettings;
settings.Color = Color.DeepPink;
}
// Save psd
im.Save(exportPath, new PsdOptions());
// Save png
im.Save(exportPathPng, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}