This small sample will show you the possibilities of Silverlights (and WPFs) BezierSegment
class. To draw a bezier curve you have to encapsulate the BezierSegment as part of
a Path element as shown in the following lines of code:
<Path x:Name="Curve" Stroke="#FFFFFFFF" StrokeThickness="2"> <Path.Data> <PathGeometry> <PathGeometry.Figures> <PathFigureCollection> <PathFigure x:Name="Figure" StartPoint="27,56"> <PathFigure.Segments> <PathSegmentCollection> <BezierSegment x:Name="Bezier" Point1="227,156" Point2="267,36" Point3="380,30" /> </PathSegmentCollection> </PathFigure.Segments> </PathFigure> </PathFigureCollection> </PathGeometry.Figures> </PathGeometry> </Path.Data> </Path>
The curve itself is rendered using four points: the StartPoint attribute of the PathFigure
element and the three points Point1, Point2 and Point3 of the BezierSegment. Try to
play around with this sample and feel free to have
a look into the sources.