当我使用BorderThickness
属性在Paragraph
中的FlowDocument
内的FlowDocumentScrollViewer
元素上绘制边框时,边框似乎模糊有时。
这是我的代码段。
<Grid>
<FlowDocumentScrollViewer>
<FlowDocument>
<Paragraph BorderBrush="Black" BorderThickness="0.5">This is a paragraph</Paragraph>
<Paragraph BorderBrush="Black" BorderThickness="0.5">This is a paragraph</Paragraph>
<Paragraph BorderBrush="Black" BorderThickness="0.5">This is a paragraph</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
</Grid>
我尝试将SnapsToDevicePixels="True"
和UseLayoutRounding="True"
放在Grid
或FlowDocumentScrollViewer
上(因为Paragraph
本身不支持这些属性),但没有任何事情发生。
这个问题仍然是个问题吗?如果没有,我该如何解决?
答案 0 :(得分:3)
<Grid RenderOptions.EdgeMode="Aliased">
<FlowDocumentScrollViewer>
<FlowDocument>
<Paragraph Margin="2" BorderBrush="Black" BorderThickness=".5">This is a paragraph</Paragraph>
<Paragraph Margin="2" BorderBrush="Black" BorderThickness=".5">This is a paragraph</Paragraph>
<Paragraph Margin="2" BorderBrush="Black" BorderThickness=".5">This is a paragraph</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
</Grid>