System.Types.OffsetRect
Delphi
function OffsetRect(var R: TRect; DX, DY: Integer): Boolean;
function OffsetRect(var R: TRectF; DX, DY: Single): Boolean;
C++
extern DELPHI_PACKAGE bool __fastcall OffsetRect(TRect &R, int DX, int DY)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Types.pas System.Types.hpp |
System.Types | System.Types |
Description
Changes the origin of a rectangle by a specified amount.
Call OffsetRect to move the upper left corner of the R
rectangle while maintaining the same width and height. The left of the rectangle moves by DX
while the top moves by DY
.
OffsetRect returns True
if the R
parameter is not nil
(Delphi) or NULL
(C++), False
if it can not return a new rectangle because R
is nil
(Delphi) or NULL
(C++).