RAD Studio VCL Reference
Types.TRect Record

TRect defines a rectangle.

TRect = record
  case Integer of
    0: (Bottom: Longint;
        Left: Longint;
        Right: Longint;
        Top: Longint;);
    1: (BottomRight: TPoint;
        TopLeft: TPoint;);
struct TRect {
  Longint Bottom;
  Longint Left;
  Longint Right;
  Longint Top;
  TPoint BottomRight;
  TPoint TopLeft;

TRect represents the dimensions of a rectangle. The coordinates are specified as either four separate integers representing the left, top, right, and bottom sides, or as two points representing the locations of the top left and bottom right corners.  

Typically, TRect values represent pixel locations, where the origin of the pixel coordinate system is in the top left corner of the screen (screen coordinates) or the top left corner of a control's client area (client coordinates). When a TRect value represents a rectangle on the screen, by convention the top and left edges are considered inside the rectangle and the bottom and right edges are considered outside the rectangle. This convention allows the width of the rectangle to be Right - Left and the height to be Bottom - Top. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!