我使用的是TextBlock控件。TextBlock中的文本以0度旋转清晰显示。
但是如果我使用LayoutTransform将控件旋转到90度,文本就不清晰了。一些模糊的显示。
有没有其他方法可以在不使用LayoutTransform的情况下旋转文本,或者是否有其他方法可以清晰地显示?
发布于 2011-08-01 17:39:15
尝试在你的TextBox上使用"UseLayoutRounding=true“
发布于 2018-04-05 17:57:49
我知道这是一个老问题,然而,我在一个用户控件上遇到了同样的问题,该控件的SnapsToDevicePixels=为“True”,UseLayoutRounding=为“True”,第一个标签下面的代码显示了一个模糊的框,而未转换的标签完美地显示了文本。我尝试将快照和舍入属性向上流动到层次结构,最后,修复此行为的唯一方法是将UseLayoutRounding=“True”应用到窗口。将其应用于任何其他子面板或用户控件都不能修复它。
<UserControl x:Class="MyApp.Controls.Indications"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
SnapsToDevicePixels="True"
UseLayoutRounding="True">
<Stackpanel>
<Label
BorderBrush="Black"
BorderThickness="1"
HorizontalAlignment="Center">
<TextBlock
Width="100"
TextAlignment="Center"
Text="Left Outboard Actuator"
TextWrapping="Wrap">
<TextBlock.LayoutTransform>
<RotateTransform
Angle="90"/>
</TextBlock.LayoutTransform>
</TextBlock>
</Label>
<Label
BorderBrush="Black"
BorderThickness="1"
HorizontalAlignment="Center">
<TextBlock
Width="100"
TextAlignment="Center"
Text="Left Outboard Actuator"
TextWrapping="Wrap">
</TextBlock>
</Label>
</Stackpanel>
</UserControl>发布于 2018-10-29 13:55:26
设置TextBlock的前景属性时,一个值(如Black)将被清除。当我将文本块旋转90度时,它在我的项目中起作用了。
https://stackoverflow.com/questions/6896282
复制相似问题