Пример #1
0
        private void ResizeManager_MouseMove(object sender, MouseEventArgs e)
        {
            if (IsMouseDown)
            {
                Label resizer = (Label)sender;
                int   index   = (int)resizer.Tag;

                if (index <= 2) // Top row
                {
                    tempRect.Y      += e.Y - my;
                    tempRect.Height -= e.Y - my;
                }
                else if (index >= 4 && index <= 6) // Bottom row
                {
                    tempRect.Height += e.Y - my;
                }

                if (index >= 2 && index <= 4) // Right row
                {
                    tempRect.Width += e.X - mx;
                }
                else if (index >= 6 || index == 0) // Left row
                {
                    tempRect.X     += e.X - mx;
                    tempRect.Width -= e.X - mx;
                }

                region.CurrentArea.Rectangle = GraphicsMgr.FixRectangle(tempRect);
                Update(tempRect);
            }
        }
Пример #2
0
        private void Crop_MouseMove(object sender, MouseEventArgs e)
        {
            IsAreaIntersect();

            if (IsMoving)
            {
                Rectangle rect = CurrentArea.Rectangle;
                rect.X               += e.X - positionOnClick.X;
                rect.Y               += e.Y - positionOnClick.Y;
                positionOnClick       = e.Location;
                CurrentArea.Rectangle = rect;
                Resize.Update();
            }

            if (IsMouseDown && CurrentArea != null && !CurrentArea.Selected)
            {
                currentPosition = GetMousePosition();
                Rectangle rect = new Rectangle(positionOnClick.X, positionOnClick.Y, currentPosition.X - positionOnClick.X, currentPosition.Y - positionOnClick.Y);
                CurrentArea.Rectangle = GraphicsMgr.FixRectangle(rect);
            }
        }