Advertisement
TLama

Untitled

Mar 27th, 2015
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.46 KB | None | 0 0
  1. var
  2.   R: TRect;
  3.   P1: TPoint;
  4.   P2: TPoint;
  5. begin
  6.   P1 := Point(10, 10);
  7.   P2 := Point(-10, -10);
  8.   // the third boolean parameter ensures the rectangle to be normalized
  9.   R := TRect.Create(P1, P2, True);
  10.   // here you can query for the rectangle's Height (but I guess that when having this normalized rectangle
  11.   // you won't need it anymore, because this is the rectangle that you can use for cropping)
  12.   ShowMessage(Format('Height: %d', [R.Height]));
  13. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement