private void DrawCroppingRectangle(Graphics g) { var rect = BitmapUtility.GetRect(CroppingManager.StartPoint, WinAPI.GetCursorPosition()); rect.Location = rect.Location.Sub(new Point(1, 1)); rect.Width++; rect.Height++; g.DrawRectangle(Pens.Black, rect); }
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; }