如果您查看下面的XAML,它會創建兩個矩形。如何讓WPF Polygon的邊框筆畫變爲實體?
XAML
<Grid>
<Rectangle Height="80" Width="300" Fill="Maroon"
HorizontalAlignment="Center" VerticalAlignment="Bottom">
</Rectangle>
<Rectangle Height="300" Width="50" Fill="LightSteelBlue"
HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="50,0">
</Rectangle>
<Polygon Fill="LightSteelBlue" Stroke="LightSteelBlue"
HorizontalAlignment="Center" VerticalAlignment="Bottom">
<Polygon.Points>
<Point X="0" Y="300"/>
<Point X="50" Y="300"/>
<Point X="50" Y="0"/>
<Point X="0" Y="0"/>
<Point X="0" Y="300"/>
</Polygon.Points>
</Polygon>
</Grid>
多邊形繪製帶有邊框是不牢固,當你放大的圖像,你會看到抗鋸齒邊緣即。有趣的是,當你畫一個矩形,你沒有得到這些(左,多邊形矩形右):
Image http://www.barramsoft.com/pub/images/BarBorders2.png
有沒有一種方法來繪製固/整齊的邊緣多邊形?