我认为对于WPF专家来说这是一个简单的问题,但现在对我来说太难了。
如何将其转换为C#代码:
<Path Fill="Red" Data="M150,300 L300,300 A150,150 0 0 0 256,194 z">
To like like:
Path p = new Path();
p.Data = Geometry...?
EllipseGeometry eg = new EllipseGeometry()
...?
答案 0 :(得分:1)
试试这个:
System.Windows.Shapes.Path p = new System.Windows.Shapes.Path();
p.Fill = Brushes.Red;
p.Data = Geometry.Parse("M150,300 L300,300 A150,150 0 0 0 256,194 z");