gpt4 book ai didi

.net - WPF中文本的外斜角效果

转载 作者:行者123 更新时间:2023-12-04 07:29:00 24 4
gpt4 key购买 nike

是否可以对 WPF 中的标签文本应用外斜角效果?

alt text

对于我来说,Glow 效果应该足够了:

alt text

最佳答案

这是一种在文本上获得发光效果的方法。使用来自 this link 的 OutlinedText 控件提供中风。

alt text

<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 的方法.

alt text
<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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com