我想知道如何在 C# 中绘制弧线,我正在尝试使用 DrawEllipse 但它不起作用并且它给出了错误的绘图。但是,我已经搜索了在类 DrawingContext 中绘制弧线的方法,但没有找到。
DrawingVisual d = new DrawingVisual();
System.Windows.Media.Pen pen = new System.Windows.Media.Pen();
DrawingContext drawingContext = d.RenderOpen();
pen.Brush = System.Windows.Media.Brushes.Black;
System.Windows.Point center = new System.Windows.Point();
center.X = 0.4;
center.Y = 0.5;
drawingContext.DrawEllipse(System.Windows.Media.Brushes.White, pen, center, 4,4);
drawingContext.Close();
canvas.Children.Add(new VisualHost { Visual = d });