System.Types.SplitRect
Delphi
function SplitRect(const Rect: TRect; SplitType: TSplitRectType; Size: Integer): TRect;
function SplitRect(const Rect: TRect; SplitType: TSplitRectType; Percent: Double): TRect;
C++
extern DELPHI_PACKAGE TRect __fastcall SplitRect(const TRect &Rect, TSplitRectType SplitType, int Size)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Types.pas System.Types.hpp |
System.Types | System.Types |
Description
Returns a rectangle obtained from the current rectangle, applying the specified splitting rule.
SplitRect returns a rectangle obtained from the current rectangle by deleting of the specified by Size
or Percent
part of the current rectangle from the side specified by SplitType
.
If a value of Size
or Percent
is negative, then SplitRect adds the specified by Size
or Percent
part of the current rectangle to the side specified by SplitType
.
SplitType
specifies which rectangle side (Left, Right, Top or Bottom) is moved when resizing a rectangle. For example, if srLeft
is specified, then the left margin of the current rectangle is moved.
Percent
defines the part of the current rectangle to be deleted or added. That is, SplitRect moves the SplitType
side onto the specified Percent
. 0
corresponds to zero percent. 1
corresponds to 100%
percent. If Percent
is positive, then the SplitType
side is moved in the direction inside the current rectangle. Otherwise, the SplitType
side is moved in the direction outside of the current rectangle.
Size
or defines the absolute size of the width or height of the part of the current rectangle to be deleted or added. That is, SplitRect moves the SplitType
side onto the specified Size
distance.