这是一种在Text上获得Glow效果的方法.使用提供Stroke的此链接中的OutlinedText控件.

<local:OutlinedText FontSize="100"
Fill="Black"
Bold="True"
Stroke="White"
StrokeThickness="3"
Text="Glow">
<local:OutlinedText.Effect>
<DropShadowEffect ShadowDepth="0"
Color="White"
Opacity="1"
BlurRadius="12"/>
</local:OutlinedText.Effect>
</local:OutlinedText>
Run Code Online (Sandbox Code Playgroud)
更新
这是我最接近斜角效果但它不能很好地工作.使用此链接的方法.

<Style x:Key="ContentControlStyle1" TargetType="{x:Type ContentControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<TextBlock Name="Highlight" Foreground="#66FFFFFF" Text="{TemplateBinding Content}" />
<TextBlock Name="Shadow" Margin="0,4,0,0" Foreground="#CC000000" Text="{TemplateBinding Content}"/>
<ContentPresenter Margin="0,2,0,0"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ContentControl Style="{DynamicResource ContentControlStyle1}" FontSize="101" Foreground="DarkGray" Content="Bevel"/>
Run Code Online (Sandbox Code Playgroud)
据我所知,这可行:
<Label Content="Hi there!">
<Label.BitmapEffect>
<OuterGlowBitmapEffect/>
</Label.BitmapEffect>
</Label>
Run Code Online (Sandbox Code Playgroud)
我还没有在标签中测试过这一点,但我已经在其他控件和形状中为我工作过,另外,请查看 IntelliSense 为您提供的所有效果列表:)
| 归档时间: |
|
| 查看次数: |
10570 次 |
| 最近记录: |