如何將XAML代碼(代表一組形狀)更改爲由PATH提供的單個圖形?XAML中從形狀到路徑的轉換
比方說,我們有XAML代碼,如:
<Ellipse Fill="#FF0A0A0E" HorizontalAlignment="Left" Margin="192,184,0,0"
Stroke="Black" Width="8" Height="8" VerticalAlignment="Top"/>
<Rectangle Fill="Black" HorizontalAlignment="Left" Margin="152,187.5,0,0"
Stroke="Black" Width="89.5" Height="1" VerticalAlignment="Top"/>
,並需要將其轉換成一個單一的路徑對象?
我試圖用混合4它允許你轉換塑造成路徑,但然後上面的代碼轉化爲:
<Path Data="M7.5,4 C7.5,5.9329966 5.9329966,7.5 4,7.5 C2.0670034,7.5 0.5,5.9329966 0.5,4 C0.5,2.0670034 2.0670034,0.5 4,0.5 C5.9329966,0.5 7.5,2.0670034 7.5,4 z"
Fill="#FF0A0A0E" HorizontalAlignment="Left" Height="8" Margin="192,184,0,0"
Stretch="Fill" Stroke="Black" VerticalAlignment="Top" Width="8"/>
<Path Data="M0.5,0.5 L89,0.5 z" Fill="Black" HorizontalAlignment="Left" Height="1"
Margin="152,187.5,0,0" Stretch="Fill" Stroke="Black" VerticalAlignment="Top"
Width="89.5" />
的原因,我提出這個問題,是因爲我只可以定義只有一個路徑。如我錯了請糾正我。如果是這樣,那麼我怎樣才能在一種風格中嵌入2個或更多路徑?
事實上,這是一個很大的幫助。謝謝!!! –