日期:2014-05-18  浏览次数:20853 次

球操作 picture里面怎么画图
我只需要画圆和直线就够了 请教怎么画

------解决方案--------------------
C# code

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            e.Graphics.DrawEllipse(Pens.Red, new Rectangle(0, 0, 100, 100));
            e.Graphics.DrawLine(Pens.Red, new Point(0, 0), new Point(100, 100));
        }

------解决方案--------------------
在picture的Paint事件中写一楼的代码。完整的如下:
 private void picture1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawEllipse(Pens.Red, new Rectangle(0, 0, 100, 100));
e.Graphics.DrawLine(Pens.Red, new Point(0, 0), new Point(100, 100));
}