DeflateRect Method

"Shrinks" a rectangle by its X and Y axis, calculates new coordinates of the object.

Applies to objects: DRect

Syntax

object.DeflateRect ( x, y )

The DeflateRect statement syntax has these parts:

Part Description
object A reference to an instance of the object.
x

A Double value, that specifies the offset for the right and left sides of the rectangle.

y A Double value, that specifies the offset for the top and bottom sides of the rectangle.

Remarks

"Shrinking" a rectangle doesn't reposition its center. The following formulas are used to calculate the coordinates:

left = left + x; top = top + x; right = right - x; bottom = bottom - x

Example

' create an instance of the object
Dim MyObject as new DRect

' set left,top,right,bottom properties of object
MyObject.SetRect(200,200,1000,1000)
' shrink the rectangle ' After the operation the values will be as follows: ' left - 300, top - 300, right - 900, bottom - 900 MyObject.DeflateRect(100,100)

 

See Also

DRect Object, InflateRect Method