Esempio n. 1
0
        private void ImageCropper_MouseUp(object sender, MouseEventArgs e)
        {
            _gripperBeingDragged = null;

            _startOfDrag = default(Point);
            if (ImageChanged != null)
            {
                ImageChanged.Invoke(this, null);
            }
        }
Esempio n. 2
0
 private void ImageCropper_MouseDown(object sender, MouseEventArgs e)
 {
     foreach (var grip in Grips)
     {
         if (grip.Contains(e.Location))
         {
             _gripperBeingDragged = grip;
             return;
         }
     }
     _startOfDrag = e.Location;
 }
Esempio n. 3
0
        private void CreateGrips()
        {
            _bottomGrip = new Grip(_sourceImageArea.Height, GripLength, GripThickness, Grip.Sides.Bottom,
                                   MiddleOfVerticalGrips,
                                   () => _topGrip.Value + MinDistanceBetweenGrips,
                                   () => _sourceImageArea.Height);

            _topGrip = new Grip(0, GripLength, GripThickness, Grip.Sides.Top,
                                MiddleOfVerticalGrips,
                                () => 0,
                                () => _bottomGrip.Value - MinDistanceBetweenGrips);
            _leftGrip = new Grip(0, GripThickness, GripLength, Grip.Sides.Left,
                                 MiddleOfHorizontalGrips,
                                 () => 0,
                                 () => _rightGrip.Value - MinDistanceBetweenGrips);

            _rightGrip = new Grip(_sourceImageArea.Width, GripThickness, GripLength, Grip.Sides.Right,
                                  MiddleOfHorizontalGrips,
                                  () => _leftGrip.Value + MinDistanceBetweenGrips,
                                  () => _sourceImageArea.Width);
        }
Esempio n. 4
0
		private void ImageCropper_MouseUp(object sender, MouseEventArgs e)
		{
			_gripperBeingDragged = null;

			_startOfDrag = default(Point);
			if (ImageChanged != null)
				ImageChanged.Invoke(this, null);
		}
Esempio n. 5
0
		private void ImageCropper_MouseDown(object sender, MouseEventArgs e)
		{

			foreach (var grip in Grips)
			{
				if (grip.Contains(e.Location))
				{
					_gripperBeingDragged = grip;
					return;
				}
			}
			_startOfDrag = e.Location;
		}
Esempio n. 6
0
		private void CreateGrips()
		{
			_bottomGrip = new Grip(_sourceImageArea.Height, GripLength, GripThickness, Grip.Sides.Bottom,
								   MiddleOfVerticalGrips,
								   () => _topGrip.Value + MinDistanceBetweenGrips,
								   () => _sourceImageArea.Height);

			_topGrip = new Grip(0, GripLength, GripThickness, Grip.Sides.Top,
								MiddleOfVerticalGrips,
								() => 0,
								() => _bottomGrip.Value - MinDistanceBetweenGrips);
			_leftGrip = new Grip(0, GripThickness, GripLength, Grip.Sides.Left,
								 MiddleOfHorizontalGrips,
								 () => 0,
								 () => _rightGrip.Value - MinDistanceBetweenGrips);

			_rightGrip = new Grip(_sourceImageArea.Width, GripThickness, GripLength, Grip.Sides.Right,
								  MiddleOfHorizontalGrips,
								  () => _leftGrip.Value + MinDistanceBetweenGrips,
								  () => _sourceImageArea.Width);
		}