private void panel1_Paint(object sender, PaintEventArgs e)
{
Graphics draw = e.Graphics;
for (int i = 0; i <=panel1.Width/20; i++)
{
draw.DrawLine(Pens.Gray, new Point(0, i * 20), new Point(panel1.Width, i * 20));
draw.DrawLine(Pens.Gray, new Point(i *20,0), new Point( i * 20,panel1.Width));
}
draw.DrawEllipse(Pens.Red,100, 100, 100, 100);//画圆
draw.DrawEllipse(Pens.Red, 200, 100, 100, 50);//画椭圆
List<Point> plist = new List<Point>();
for (int i = 0; i < 20; i++)
{
Point p = new Point(i+i*2-1,i*i);
plist.Add(p);
}
draw.DrawCurve(Pens.Red, plist.ToArray());//画曲线/抛物线
draw.DrawPie(Pens.Red, 300, 60, 300, 300, 100, 100);//画扇形
}