如果我呈現以下:渲染銳利的線條在WPF
<Grid>
<Canvas SnapsToDevicePixels="True">
<Path Fill="#FF000000" SnapsToDevicePixels="True" Data="M 0.00,0.00 L 2.50,0.00 0.00,10.00 " />
<Path Fill="#FF260014" SnapsToDevicePixels="True" Data="M 2.50,0.00 L 7.50,0.00 2.50,10.00 0.00,10.00 " />
<Canvas.RenderTransform>
<ScaleTransform ScaleX="{Binding ElementName=slider,Path=Value}" ScaleY="{Binding ElementName=slider,Path=Value}" />
</Canvas.RenderTransform>
</Canvas>
<Slider x:Name="slider" Minimum="0" Maximum="50" Value="30"/>
</Grid>
我得到這樣的結果(Kaxaml):
通知兩個形狀之間的細白線。我四處搜索,發現這與像素對齊有關。我希望設置SnapsToDevicePixels="True"
將足以擺脫線路,但這是行不通的!
任何想法如何擺脫白線?
酷工作,非常感謝! – 2009-12-01 09:59:52