62,046
社区成员
发帖
与我相关
我的任务
分享
Graphics g = this.CreateGraphics();
int maxValue = 500;//最大值
int currentValue = 400;//当前值
//计算实际角度
var angle = Convert.ToInt32((180.0 / maxValue * currentValue));
GraphicsPath path = new GraphicsPath();
path.AddPie(50, 50, 200, 200, 180, angle);
g.FillPath(new SolidBrush(Color.Blue), path);
path.Reset();
path.AddPie(75, 75, 150, 150, 180, angle);
g.FillPath(new SolidBrush(this.BackColor), path);
path.Reset();
path.AddArc(50, 50, 200, 200, 180, 180);
path.AddArc(75, 75, 150, 150, 180, 180);
path.CloseFigure();
g.DrawPath(new Pen(Color.Red), path);
文件自己去画,自己可以再优化,加上渐变什么的