Beispiel #1
0
        private void picShape_MouseUp(object sender, MouseEventArgs e)
        {
            if(_tool == TypesOfTool.Zone)
            {

                switch(_zoneMode)
                {
                    case ModesOfZone.SetEnterRadiusAngle:
                        _zoneMode = ModesOfZone.SetEnterArc;
                        break;
                    case ModesOfZone.SetEnterArc:
                        _zoneMode = ModesOfZone.SetExitRadiusAngle;
                        break;
                    case ModesOfZone.SetExitArc:
                        _tool = TypesOfTool.Paint;
                        break;
                    case ModesOfZone.SetExitRadiusAngleEx:
                        _zoneMode = ModesOfZone.SetExitArc;
                        break;
                }

            }
        }
Beispiel #2
0
        private void picShape_MouseDown(object sender, MouseEventArgs e)
        {
            switch(_tool)
            {

                case TypesOfTool.Paint:
                    if(e.Button == MouseButtons.Left || e.Button == MouseButtons.Right)
                        if(e.Button == MouseButtons.Left)
                            SetPixelLock(e.X, e.Y, true, false);
                        else
                            SetPixelLock(e.X, e.Y, false, false);
                    break;

                case TypesOfTool.Zone:
                    switch(_zoneMode)
                    {
                        case ModesOfZone.SetCentre:
                            _zone = new Zone(_shape);
                            _zone.X = e.X;
                            _zone.Y = e.Y;
                            float mx = e.X, my = e.Y;
                            MapXY(ref mx, ref my);
                            _zone.X = mx;
                            _zone.Y = my;
                            _shape.Zones.Add(_zone);
                            _zoneMode = ModesOfZone.SetEnterRadiusAngle;
                            break;
                        case ModesOfZone.SetExitRadiusAngle:
                            _zoneMode = ModesOfZone.SetExitArc;
                            break;
                    }
                    break;

            }
        }
Beispiel #3
0
        private void picShape_MouseMove(object sender, MouseEventArgs e)
        {
            _mouseX = e.X;
            _mouseY = e.Y;

            float fx = e.X, fy = e.Y;
            MapXY(ref fx, ref fy);
            int x = (int)fx, y = (int)fy;
            if(x >= 0 && y >= 0 && x < _shape.Width && y < _shape.Height)
            {
                stsCoords.Text = x.ToString("0") + ", " + y.ToString("0");
                setPaintStatus(stsCanvas, _shape.Pixels.Pixel[x, y].Weight, _shape.Pixels.Pixel[x, y].Radius, _shape.Pixels.Pixel[x, y].Falloff);
            }

            switch(_tool)
            {

                case TypesOfTool.Paint:
                    if(e.Button != MouseButtons.None)
                        picShape_MouseDown(sender, e);
                    else
                        picShape.Invalidate();
                    break;

                case TypesOfTool.Zone:
                    switch(_zoneMode)
                    {

                        case ModesOfZone.SetEnterRadiusAngle:
                            _zone.EnterRadius = radius(_zone.X, _zone.Y, fx, fy);
                            _zone.EnterAngle = angle(UnMapX(_zone.X), UnMapY(_zone.Y), e.X, e.Y);
                            break;

                        case ModesOfZone.SetEnterArc:
                            _zone.EnterArc = _zone.EnterAngle - angle(UnMapX(_zone.X), UnMapY(_zone.Y), e.X, e.Y);
                            if(e.Button == MouseButtons.Left)
                                _zoneMode = ModesOfZone.SetExitRadiusAngleEx;
                            break;

                        case ModesOfZone.SetExitRadiusAngle:
                        case ModesOfZone.SetExitRadiusAngleEx:
                            _zone.ExitRadius = radius(_zone.X, _zone.Y, fx, fy);
                            _zone.ExitAngle = angle(UnMapX(_zone.X), UnMapY(_zone.Y), e.X, e.Y);
                            break;

                        case ModesOfZone.SetExitArc:
                            _zone.ExitArc = _zone.ExitAngle - angle(UnMapX(_zone.X), UnMapY(_zone.Y), e.X, e.Y);
                            break;

                    }
                    picShape.Invalidate();
                    break;

            }
        }
Beispiel #4
0
 public void mnuZoneAdd_Click(object sender, EventArgs e)
 {
     mnuImageSelect.Checked = false;
     mnuImagePaint.Checked = false;
     mnuImageDraw.Checked = false;
     mnuImageLine.Checked = false;
     mnuZoneAdd.Checked = true;
     _tool = TypesOfTool.Zone;
     _zoneMode = ModesOfZone.SetCentre;
     stsTool.Text = "Zone";
 }