RectangleF class

RectangleF class

Stores a set of four floating-point numbers that represent the location and size of a rectangle.

The RectangleF type exposes the following members:

Constructors

ConstructorDescription
initInitializes a new instance of the RectangleF structure with the specified location and size.
initInitializes a new instance of the RectangleF structure with the specified location and size.
initConstructs a new instance of RectangleF

Properties

PropertyDescription
emptyGets a new instance of the RectangleF structure that has RectangleF.x, RectangleF.y, RectangleF.width and RectangleF.height values set to zero.
locationGets or sets the coordinates of the upper-left corner of this RectangleF structure.
sizeGets or sets the size of this RectangleF.
xGets or sets the x-coordinate of the upper-left corner of this RectangleF structure.
yGets or sets the y-coordinate of the upper-left corner of this RectangleF structure.
widthGets or sets the width of this RectangleF structure.
heightGets or sets the height of this RectangleF structure.
leftGets or sets the x-coordinate of the left edge of this RectangleF structure.
topGets or sets the y-coordinate of the top edge of this RectangleF structure.
rightGets or sets the x-coordinate that is the sum of RectangleF.x and RectangleF.width of this RectangleF structure.
bottomGets or sets the y-coordinate that is the sum of RectangleF.y and RectangleF.height of this RectangleF structure.
is_emptyGets a value indicating whether the RectangleF.width or RectangleF.height property of this RectangleF has a value of zero.

Methods

MethodDescription
inflateCreates and returns an inflated copy of the specified RectangleF structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.
inflateInflates this RectangleF structure by the specified amount.
inflateInflates this RectangleF by the specified amount.
intersectReturns a RectangleF structure that represents the intersection of two rectangles. If there is no intersection, and empty RectangleF is returned.
intersectReplaces this RectangleF structure with the intersection of itself and the specified RectangleF structure.
containsDetermines if the specified point is contained within this RectangleF structure.
containsDetermines if the specified point is contained within this RectangleF structure.
containsDetermines if the rectangular region represented by rect is entirely contained within this RectangleF structure.
offsetAdjusts the location of this rectangle by the specified amount.
offsetAdjusts the location of this rectangle by the specified amount.
from_pointsCreates a new Rectangle from two points specified. Two verticles of the created Rectangle will be equal to the passed point1 and point2. These would be typically the opposite vertices.
unionCreates the smallest possible third rectangle that can contain both of two rectangles that form a union.
from_left_top_right_bottomCreates a RectangleF structure with upper-left corner and lower-right corner at the specified locations.
normalizeNormalizes the rectangle by making it’s width and height positive, left less than right and top less than bottom.
intersects_withDetermines if this rectangle intersects with rect.

See Also