Beispiel #1
0
        private void pbCanvas_Click(object sender, EventArgs e)
        {
            Point mousePos = pbCanvas.PointToClient(MousePosition);

            if (checkBoxPolygon.Checked)
            {
                if (((MouseEventArgs)e).Button == MouseButtons.Left)
                {
                    ManagerDraw.InputPolygon(mousePos, ModifierKeys == Keys.Shift);
                }
                else if (((MouseEventArgs)e).Button == MouseButtons.Right)
                {
                    ManagerDraw.ClosePolygon();
                }
            }
            else
            {
                if (((MouseEventArgs)e).Button == MouseButtons.Left)
                {
                    ManagerDraw.InputCutter(mousePos, ModifierKeys == Keys.Shift);
                }
                else if (((MouseEventArgs)e).Button == MouseButtons.Right)
                {
                    ManagerDraw.CloseCutter();
                }
            }
        }
Beispiel #2
0
        private void Canvas_Click(object sender, EventArgs e)
        {
            Point mousePos = Canvas.PointToClient(MousePosition);

            if (((MouseEventArgs)e).Button == MouseButtons.Left)
            {
                if (IsInputVertHorLine())
                {
                    ManagerDraw.AddHorVertLinePolygon(mousePos);
                }

                else if (isInputSeed())
                {
                    ManagerDraw.ClearCanvas();
                    ManagerDraw.DrawPolygons();
                    if (numericUpDownDelay.Value != 0)
                    {
                        FillingSeed.FillAreaWithDelay(ManagerDraw.Canvas, ManagerDraw.PenFill.Color, ManagerDraw.PenEdges.Color, mousePos, Canvas, (int)numericUpDownDelay.Value);
                    }
                    else
                    {
                        FillingSeed.FillArea(ManagerDraw.Canvas, ManagerDraw.PenFill.Color, ManagerDraw.PenEdges.Color, mousePos);
                    }
                    Canvas.Refresh();
                }
                else
                {
                    ManagerDraw.AddPointPolygon(mousePos);
                }
            }

            if (((MouseEventArgs)e).Button == MouseButtons.Right)
            {
                ManagerDraw.ClosePolygon();
            }
        }