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 rectangle specified by Rect 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 Rect parameter is not nil (Delphi) or NULL (C++), false if it can't return a new rectangle because Rect is nil(Delphi) or NULL (C++).