0

is there a way to crop a rectangular out of a bitmap? The new image section lies obliquely in the original image.

I know the way how to do this using a starting point, width and height. But is there a way to do this using two diagonal points?

Any ideas?

TaW
  • 53,122
  • 8
  • 69
  • 111
x3738x
  • 1
  • 1
  • What would be the difference?? The 2nd point is width and height away from the first! Use this handy function: `static public Rectangle GetRectangle(Point p1, Point p2) { return new Rectangle(Math.Min(p1.X, p2.X), Math.Min(p1.Y, p2.Y), Math.Abs(p1.X - p2.X), Math.Abs(p1.Y - p2.Y)); }` – TaW Nov 24 '16 at 18:15
  • Thank you very much for your reply. That seems easy :) Tomorrow I will test it. – x3738x Nov 24 '16 at 18:52

0 Answers0