RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Types.OffsetRect Function

Changes the origin of a rectangle by a specified amount.

Pascal
function OffsetRect(var Rect: TRect; DX: Integer; DY: Integer): Boolean;
C++
Boolean OffsetRect(TRect Rect, int DX, int DY);

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++). 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!