I’m trying to convert some more complex SVG Paths to the equivalent XAML PathSegement elements, and have run into another major stumbling block that I can’t seem to find an easy way around. In SVG, when describing a path, we can mix relative and absolute positioning when defining the path data. All the XAML PathSegment examples I’ve found only use Absolute coordinates for their points. I would think that there is some way to switch to relative coordinates in the PathSegment, but haven’t figured out a way to do this.
In SVG the data attribute of the path element would be something like this: d="M 0,40 c 10,25 0,50 100,100z". This basically says start at coordinate 0,40, create a bezier segment using the following 4 points, the starting position (0,40), Point1 is (10,25) relative to the starting position, Point 2 is (0,50) relative to the starting position, and the ending position (aka Point 3) is (100,100) relative to the starting position. The z just closes the path.
Now in XAML I’d like to do the same:
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<PathFigure>
<PathFigure.Segments>
<PathSegmentCollection>
<StartSegment Point="0,40"/>
<BezierSegment Point1="10,25" Point2="0,50" Point3="100,100"/>
<CloseSegment />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
But this example is in Absolute Positioning. Point1 is coordinate (10,25) instead of the desired coordinate of (10,65). I could just do that math to translate the points, but I would think that there is some declarative way to get the BezierSegment to switch to relative positioning.
DonXML