[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'Types' (#rtl)


Rectangle in a plane


Source position: typshrdh.inc line 101

type TRect = packed record


  constructor Create();

  class operator equal(TRect,TRect):Boolean();

  class operator notequal(TRect,TRect):Boolean();

  class operator add(TRect,TRect):TRect();

  class operator multiply(TRect,TRect):TRect();

  class function Empty;

  procedure NormalizeRect;

  function IsEmpty;

  function Contains();

  function IntersectsWith();

  class function Intersect();

  class function Union();

  procedure Offset();

  procedure SetLocation();

  procedure Inflate();

  function CenterPoint;

  function SplitRect();

  property Height: LongInt; [rw]

  property Width: LongInt; [rw]

  property Size: TSize; [rw]

  property Location: TPoint; [rw]

  case LongInt of

    0: (

        Left: LongInt;


Horizontal position of left edge

        Top: LongInt;


Vertical position of top edge

        Right: LongInt;


Horizontal position of right edge

        Bottom: LongInt;


Vertical position of bottom edge


    1: (

        TopLeft: TPoint;


Position of top-left corner

        BottomRight: TPoint;


Position of bottom-right corner


    2: (

        Vector: TArray4IntegerType;




TRect defines a rectangle in a discrete plane. It is described by the horizontal (left, right) or vertical (top, Bottom) positions (in pixels) of the edges, or, alternatively, by the coordinates of the top left (TopLeft) and bottom right (BottomRight) corners.

See also



Point in a plane



Area size

Documentation generated on: May 14 2021