我有一个 Silverlight
应用程序,我想给我的 textblock
一个大纲(不是文本 block ,字符 本身),也称为 stroke
。
我找到了 this question它适用于 WPF
,但是在使用 XAML/Silverlight
时是否有办法实现此目的(PresentationFramework
不是 Silverlight
程序集)?有现成的实现吗?
最佳答案
按照@Chris W. 的想法,我想出了这段代码,虽然不是最好的解决方案,但它有效:
<StackPanel>
<!-- With DropShadow -->
<TextBlock Foreground="#FFFF0000" Text="With DropShadow" FontSize="16">
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="0" BlurRadius="1" Color="#FF000000" />
</TextBlock.Effect>
</TextBlock>
<!-- No DropShadow -->
<TextBlock Foreground="#FFFF0000" Text="No DropShadow" FontSize="16" />
</StackPanel>
关于c# - 将描边应用于 XAML 中的文本 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17835250/