Exemplo n.º 1
0
        private void pictureBox3_MouseMove(object sender, MouseEventArgs e)
        {
            bool test = false;

            if (colorNodeLeft != null)
            {
                test = true;
                left.ChangeColors(colorNodeLeft, Color.Black);
            }

            colorNodeLeft = left.FindClosestNode(e.X, e.Y);

            if (colorNodeLeft != null)
            {
                left.ChangeColors(colorNodeLeft, Color.Red);
                test = true;
            }
            if (test)
            {
                Graphics g = Graphics.FromImage(leftBitMap);
                g.Clear(pictureBox3.BackColor);

                pictureBox3.Refresh();
            }
        }
Exemplo n.º 2
0
        private void pictureBox2_MouseMove(object sender, MouseEventArgs e)
        {
            bool test = false;

            if (colorNodeUpper != null)
            {
                upper.ChangeColors(colorNodeUpper, Color.Black);
                test = true;
            }

            colorNodeUpper = upper.FindClosestNode(e.X, e.Y);

            if (colorNodeUpper != null)
            {
                upper.ChangeColors(colorNodeUpper, Color.Red);
                test = true;
            }
            if (test)
            {
                Graphics g = Graphics.FromImage(upperBitMap);
                g.Clear(pictureBox2.BackColor);
                pictureBox2.Refresh();
            }
        }