System.Types.TRectF.PlaceInto

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function PlaceInto(const ADesignatedArea: TRectF; const AHorzAlign: THorzRectAlign = THorzRectAlign.Center;
const AVertAlign: TVertRectAlign = TVertRectAlign.Center): TRectF;

C++

inline TRectF TRectF::PlaceInto(const TRectF& DesignatedArea,
                                THorzRectAlign HorzAlign,
                                TVertRectAlign VertAlign) const {

Properties

Type Visibility Source Unit Parent
function public
System.Types.pas
SystemTypes.h
System.Types TRectF

Description

If any dimension of the current rectangle is greater than the corresponding dimension of the ADesignatedArea rectangle, then the current rectangle is scaled down to best fit the ADesignatedArea rectangle. The obtained rectangle is aligned in ADesignatedArea.

PlaceInto implements the following behavior:

  • If the width or height of the current rectangle is greater than the corresponding dimension of ADesignatedArea. Then PlaceInto scales down the current rectangle (preserving the current rectangle proportions – the ratio between the width and height) to fit in the ADesignatedArea rectangle and centers the scaled rectangle in ADesignatedArea. Then PlaceInto aligns the obtained rectangle in the ADesignatedArea rectangle according to the specified AHorzAlign and AVertAlign. By default, PlaceInto centers the scaled rectangle in the ADesignatedArea rectangle.
  • Otherwise, PlaceInto just aligns the current rectangle in the ADesignatedArea rectangle according to the specified AHorzAlign and AVertAlign. By default, PlaceInto centers the scaled rectangle in the ADesignatedArea rectangle.
  • PlaceInto returns the current rectangle if any of the ADesignatedArea dimensions is zero.

See Also