1. 程式人生 > >WPF 字型陰影及漸變字效果示例程式碼

WPF 字型陰影及漸變字效果示例程式碼

<TextBlock Name="copor" Height="37"  Width="993" FontSize="28" Margin="6,37,0,0" Text="觸控式螢幕系統" HorizontalAlignment="Center" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" FontWeight="ExtraBold" >
                    <TextBlock.Effect>
                        <DropShadowEffect Color="#464646" BlurRadius="2" ShadowDepth="2" Opacity="1" />
                    </TextBlock.Effect>
                <TextBlock.Foreground>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStop Offset="0.0" Color="#ffffff" />
                            <GradientStop Offset="1.0" Color="#b7b7b7" />
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </TextBlock.Foreground>
            </TextBlock>