是否可以对 WPF 中的标签文本应用外斜角效果?
对于我来说,Glow 效果应该足够了:
最佳答案
这是一种在文本上获得发光效果的方法。使用来自 this link 的 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>
更新
这是我最接近斜角效果的方法,但效果不佳。使用了来自 this link 的方法.
<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"/>
关于.net - WPF中文本的外斜角效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4334704/