class{
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
SolidBrush brush = new SolidBrush(Color.DarkRed);
Pen pen = new Pen(brush);
foreach (Point pt in breakPointList)
{
g.DrawEllipse(new Pen(brush), pt.X-6, pt.Y-6, 12, 12);
g.FillEllipse(brush, pt.X - 6, pt.Y - 6, 12, 12);
}
}
List<Point> breakPointList = new List<Point>();
private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
{
breakPointList.Add(new Point(e.X, e.Y));
this.pictureBox1.Refresh(); //引发Paint 函数
}
}
posted on 2008-09-16 20:30
天书 阅读(318)
评论(0) 编辑 收藏 引用