내부 그림자 효과
Aspose.PSD for .NET을 사용하면 개발자들은 다양한 요소에 내부 그림자 효과를 설정할 수 있습니다. 내부 그림자 효과는 객체 내부에 퍼진 그림자를 추가하고 색상, 오프셋 및 흐림을 조정하는 데 사용됩니다.
아래는 해당 기능의 코드 예시입니다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET | |
string destName = dataDir + "innershadow_out.psd"; | |
var loadOptions = new PsdLoadOptions() | |
{ | |
LoadEffectsResource = true | |
}; | |
// Load an existing image into an instance of PsdImage class | |
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(destName, new PsdOptions(image)); | |
} |