我认为这对WPF专家来说很简单,但现在对我来说太难了。
如何将其转换为 C# 代码:
<Path Fill="Red" Data="M150,300 L300,300 A150,150 0 0 0 256,194 z">
像这样:
Path p = new Path();
p.Data = Geometry...?
EllipseGeometry eg = new EllipseGeometry()
...?
试试这个:
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");