public void DrawPoint(Color colorPoint, Graphics formGraphics, PointOfFigure point) { int sizePoint = 10; var brush = new SolidBrush(colorPoint); var font = new Font("Times New Roman", 18); formGraphics.FillEllipse(brush, point.Coordinates.X - sizePoint / 2, point.Coordinates.Y - sizePoint / 2, sizePoint, sizePoint); formGraphics.DrawString(point.Number.ToString(), font, brush, point.Coordinates.X - sizePoint * 2, point.Coordinates.Y - sizePoint * 2); }
private void Form1_MouseDown(object sender, MouseEventArgs e) { if (numberPoints > 0 && numberPoints != startNumber) { var point = new PointOfFigure(new Point(e.X, e.Y), startNumber + 1); drawStartPoints.AddPointInList(point); drawStartPoints.DrawPoint(Color.Blue, formGraphics, point); startNumber++; } if (numberPoints > 0 && numberPoints == startNumber) { drawStartPoints.DrawLines(Color.Blue, formGraphics, drawStartPoints.ListPoints); } }
public void AddPointInList(PointOfFigure point) { listPoints.Add(point); }