Beispiel #1
0
        /// <summary>
        /// Função para marcar as cidades
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMouseClick(MouseEventArgs e)
        {
            base.OnMouseClick(e);

            Pen blackPen = new Pen(Color.Aquamarine, 3);
            int X        = e.X;
            int Y        = e.Y;

            //TablePoints.AddPoint(X, Y);

            Rectangle rec = new Rectangle(X - 5, Y - 5, 10, 10);

            g.DrawEllipse(blackPen, rec);

            //distancias entre as coordenadas X,Y -> para mostrar na tela
            g.DrawString((pointCount + 1).ToString(), new Font("Arial Black", 11), Brushes.Black, X + 3, Y);
            g.DrawString("X :" + X.ToString(), new Font("Arial Black", 6), Brushes.Black, X - 20, Y - 25);
            g.DrawString("Y :" + Y.ToString(), new Font("Arial Black", 6), Brushes.Black, X - 20, Y - 12);

            pointCount++;
            lbQtdCidade.Text = pointCount.ToString();
            lbComplex.Text   = Fatorial((ulong)pointCount).ToString();

            Console.WriteLine(TablePoints.Print());
        }