0

I have a path that I need to convert to X, Y points but I researched very much and didn't find any solution.

For instance, this is my path:

<?xml version="1.0" standalone="no"?>
<svg width="4cm" height="4cm" viewBox="0 0 400 400"
 xmlns="http://www.w3.org/2000/svg" version="1.1">
 <title>Example triangle01- simple example of a 'path'</title>
<desc>A path that draws a triangle</desc>
<rect x="1" y="1" width="398" height="398"
    fill="none" stroke="blue" />
<path d="M 100 100 L 300 100 L 200 300 z"
    fill="red" stroke="blue" stroke-width="3" />
</svg>

now I want to get x,y points in C#. Thanks!!!

  • Of just the `path` part of the SVG? The number pairs in the `d` attribute are literally x,y coordinates. – Johnny Westlake Apr 23 '20 at 12:28
  • Im still (after maby years) looking for a good c# solution for dealing with SVG.. still not much luck.. but i have had great success with WPF Geometry.Parse(pathData) it uses the same path data and gives you a geometry object with all the goodies and shapes that make up that path. Only downside is it depends on windows – Tim Davis Jul 27 '20 at 06:02

0 Answers0