InflateRect Method

"Enlarges" the rectangle by the X and Y axes, calculates the coordinates of the object.

Applies to objects: DRect

Syntax

object.InflateRect ( x, y )

The InflateRect method syntax has these parts:

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

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

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

Remarks

"Enlarging" the 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
MyObject.SetRect(200,200,1000,1000)
' Inflate rectangle ' After the operation the properties will be equal to: ' left - 100, top - 100, right - 1100, bottom - 1100 MyObject.InflateRect(100,100)

 

See Also

DRect Object, DeflateRect Method