2011-03-04 64 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