我想繪製一個空的橢圓內(如單選按鈕)內的填充橢圓,整個事情是可擴展的。奇怪的WPF對齊網格
我已經試過這種方式(電網看起來必要的,如果我使用一個邊框的比例不會看起來是一樣的)
<Grid Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
<RowDefinition Height="5*" />
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="5*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Ellipse Stroke="Black" StrokeThickness="3" Grid.RowSpan="3" Grid.ColumnSpan="3"></Ellipse>
<Ellipse StrokeThickness="0" Fill="Red" Grid.Row="1" Grid.Column="1" />
</Grid>
當控制爲30×30,填充的橢圓不看居中,有一個小的偏移量(看起來更接近右下角)。 如果我將2-5-2更改爲1-2-1,它看起來更接近左上角。
任何想法,爲什麼它的行爲是這樣嗎?更重要的是,我怎樣才能讓它更加對稱?
謝謝你提前(對不起我的英文不好)任何幫助。 (順便說一下,我使用.Net FW 4.5)