C#再windowForm窗体中绘画扇形并给其填充颜色
Graphics graphics = this.CreateGraphics();
graphics.SmoothingMode = SmoothingMode.AntiAlias;
int width = this.Width;
int height = this.Height;
h = this.Height;
w = this.Width;
Rectangle rct = new Rectangle(0 - h / 6, 0 - h / 6, h / 2, h / 2);
Brush brush = new SolidBrush(Color.Green);
Brush brush1 = new SolidBrush(Color.White);
graphics.FillPie(brush1, rct, 0, 90);//填充扇形;
graphics.FillPie(brush, rct, 0, 45);//填充扇形;
效果图