看看绘制贝塞尔曲线(MSDN Link),了解不同的几何类型(MSDN Link)
下面是一个代码示例,让你开始,将产生如下图:
<Canvas x:Name="LayoutRoot" Background="White">
<Path Stroke="Blue" StrokeThickness="2" >
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<PathFigure StartPoint="50,50">
<PathFigure.Segments>
<PathSegmentCollection>
<BezierSegment
Point1="50,20"
Point2="120,170"
Point3="350,150"
/>
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
<Path Fill="Gold" Stroke="Black" StrokeThickness="1">
<Path.Data>
<EllipseGeometry Center="50,50" RadiusX="20" RadiusY="20" />
</Path.Data>
</Path>
<Path Fill="Gold" Stroke="Black" StrokeThickness="1">
<Path.Data>
<EllipseGeometry Center="350,150" RadiusX="20" RadiusY="20" />
</Path.Data>
</Path>
</Canvas>
有没有办法用简单的“Line”类来做到这一点? – vondip 2011-04-05 02:56:09
一条线只能是一条直线。您在这里没有太多选择。贝塞尔曲线绝对是你最好的,也是唯一的选择。 – 2011-04-05 03:08:02
我明白了,你知道任何开源框架,它们很容易支持它们之间的定位点和绘图吗? – vondip 2011-04-05 03:13:50