private void pictureBox1_Click(object sender, EventArgs e)
{
Point p = PointToClient(new Point(Cursor.Position.X, Cursor.Position.Y)
p.X -= picturebox.Left;
p.Y -= picturebox.Top;
pointlist.add(p);
if (pointlist.Count > 1) //a line can be drawn
{
//draw a line between the point just clicked (lastpoint) and the point preceeding it
Point lastpoint = pointlist[pontlist.Count-1]
Point secondlastpoint = pointlist[pontlist.Count-2]
Graphics.FromImage(pictureBox1.Image).DrawLine(new Pen(Color.Black), secondlastpoint,lastpoint);
}
}