Пример #1
0
        private void CropPictureBox_SizeChanged(object sender, EventArgs e)
        {
            CropPictureBox.Invalidate();

            if (CropPictureBox.Image != null)
            {
                OnCropPictureBoxResize();
            }
        }
Пример #2
0
        private void CropPictureBox_MouseDown(object sender, MouseEventArgs e)
        {
            CropPictureBox.Invalidate();

            _cropArea.X      = e.X;
            _cropArea.Y      = e.Y;
            _cropArea.Width  = 0;
            _cropArea.Height = 0;
            _isMouseDown     = true;
        }
Пример #3
0
        private void CropPictureBox_MouseMove(object sender, MouseEventArgs e)
        {
            if (_isMouseDown)
            {
                _cropArea.Width  = (e.X - _cropArea.X);
                _cropArea.Height = (e.Y - _cropArea.Y);

                if (_cropAreaBounds.Contains(_cropArea))
                {
                    CropPictureBox.Invalidate();
                }
            }
        }