Beispiel #1
0
        private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            buttonSwitch.DeactivateButton();
            if (buttonSwitch is PipetteButton)
            {
                pictureBoxCurrentColor.BackColor = currentColor;
                buttonSwitch = new NoneButton();
            }
            else
            {
                currentColor = pictureBoxCurrentColor.BackColor;
            }

            if (Math.Abs(e.X - PointPolygonPainter.first.X) < 10 && Math.Abs(e.Y - PointPolygonPainter.first.Y) < 10 && PointPolygonPainter.first.X != -1)
            {
                new PointPolygonPainter(currentColor, size).ConnectLastAndFirst(pictureBox1);
            }
            else if (PointPolygonPainter.first.X != -1)
            {
                PointPolygonPainter.last.X = e.X;
                PointPolygonPainter.last.Y = e.Y;
            }
            drawStartFinishFlag = false;
        }