private void btnDrawLineByPoints_Click(object sender, EventArgs e) { PointFZuma p1 = new PointFZuma(float.Parse(txtX1.Text), float.Parse(txtY1.Text)); PointFZuma p2 = new PointFZuma(float.Parse(txtX2.Text), float.Parse(txtY2.Text)); Field field = new Field(400, 350); LinePath path = new LinePath(field, p1, p2); for (int i = 0; i < path.Points.Length; i++) { PointFZuma p = path.Points[i]; ((Bitmap)pictureBox3.Image).SetPixel((int)p.X, (int)p.Y, Color.Red); } pictureBox3.Invalidate(); }