CenterPoint (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example illustrates how to use the CenterPoint routine to return the center point of a rectangle.

Code

uses
  System.SysUtils, System.Types;
var
  aRectangle:TRect;
  aPoint:TPoint;
...
begin
    aRectangle := Bounds(4, 5, 16, 25);
    aPoint := CenterPoint(aRectangle);
    //assigned aRectangle's center point coordinates to aPoint
    writeln(aPoint.X, ' ', aPoint.Y);
end.

Uses