예제 #1
0
        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);
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public void AddPointInList(PointOfFigure point)
 {
     listPoints.Add(point);
 }