2011-03-04 97 views
3

在WPF中,是否可以將其編碼爲具有Data屬性的單個Path標記?對WPF路徑數據進行編碼

<Path Stroke="White" StrokeThickness="2"> 
    <Path.Data> 
     <PathGeometry> 
      <PathFigure StartPoint="7,32"> 
       <ArcSegment Point="7,18" Size="200,50" RotationAngle="0" IsLargeArc="False" /> 
      </PathFigure> 
     </PathGeometry> 
    </Path.Data> 
</Path> 

事情是這樣的:(僅這是一個完全錯誤的形狀)

<Path Stroke="DarkGoldenRod" StrokeThickness="3" 
Data="M 100,200 C 100,25 400,350 400,175 H 280" /> 

回答

5

試試這個:

<Path Data="M 7,32 A 200,50 0 0 0 7,18" .../> 

參見Path Markup Syntax