Beispiel #1
0
 /// <summary>
 /// Notify our host that someone double clicked the pictureBox. Keep in mind that a
 /// double click event also causes two mouse down events and one mouse up event prior to
 /// triggering this event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnMouseDoubleClick(object sender, MouseEventArgs e)
 {
     _theRectDrawing = _backupRectangle;
     _curOp          = Operation.none;
     _isDragging     = false;
     ImageCropped?.Invoke(this, e);
 }
        public void EndCropImage(Point endPoint)
        {
            var r = BitmapUtility.GetRect(StartPoint, endPoint);

            if (r.Width < 10 || r.Height < 10)
            {
                return;
            }

            var bmp = BitmapUtility.TakeScreenshotOfSpecificRect(StartPoint, endPoint);

            CreateNewAsset(bmp);

            ImageCropped?.Invoke(bmp);
            ImageCropEnded?.Invoke(endPoint);

            IsCropping = false;
            StartPoint = Point.Empty;
        }