[C#/WPF] TextBlock 엘리먼트 : Effects 속성에서 DropShadowEffect 객체를 사용해 텍스트 그림자 만들기
C#/WPF 2022. 12. 16. 19:24728x90
반응형
728x170
■ TextBlock 엘리먼트의 Effects 속성에서 DropShadowEffect 객체를 사용해 텍스트 그림자를 만드는 방법을 보여준다.
▶ MainWindow.xaml
<Window x:Class="TestProject.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="800"
Height="600"
Title="TestProject"
FontFamily="나눔고딕코딩"
FontSize="16">
<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock
Foreground="Teal"
FontSize="48"
Text="Shadow Text">
<TextBlock.Effect>
<DropShadowEffect
Direction="330"
ShadowDepth="4"
BlurRadius="4"
Opacity="0.5"
Color="Black" />
</TextBlock.Effect>
</TextBlock>
<TextBlock
Margin="0 10 0 0"
Foreground="Maroon"
FontSize="48"
Text="Shadow Text">
<TextBlock.Effect>
<DropShadowEffect
Direction="135"
ShadowDepth="6"
BlurRadius="0.0"
Opacity="0.35"
Color="Maroon" />
</TextBlock.Effect>
</TextBlock>
</StackPanel>
</Window>
728x90
반응형
그리드형(광고전용)
댓글을 달아 주세요