System::Drawing::RectangleF class

RectangleF class

Represents a rectangular area of an image defined as single-precision floating point X and Y coordinates of its upper left corner and its width and height. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

class RectangleF

Methods

MethodDescription
Contains(float, float)Determines if the specified point is located within the rectangle represented by the current object.
Contains(const PointF&)Determines if the specified point is located within the rectangle represented by the current object.
Contains(const RectangleF&)Determines if the specified rectangle is located within the rectangle represented by the current object.
Equals(const RectangleF&) constDetermines if the rectangles represented by the current and the specified objects are identical.
static FromLTRB(float, float, float, float)Constructs a new RectangleF object that represents a rectangle with the specified edge locations.
get_Bottom() constReturns the y coordinate of the bottom edge of the rectangle represented by the current object.
get_Height() constReturns the height of the rectangle represented by the current object.
get_IsEmpty() constDetermines if X and Y coordinates of the upper left corner of the recangle represented by the current object as well as its width and height have values of 0.
get_Left() constReturns the X coordinate of the left edge of the rectangle represented by the current object.
get_Location() constReturns an instance of the PointF class that specifies the location of the upper left corner of the rectangle represented by the current object.
get_Right() constReturns the X coordinate of the right edge of the rectangle represented by the current object.
get_Size() constReturns an instance of the SizeF class that specifies the width and height of the rectangle represented by the current object.
get_Top() constReturns the Y coordinate of the top edge of the rectangle represented by the current object.
get_Width() constReturns the width of the rectangle represented by the current object.
get_X() constReturns the X coordinate of the upper left corner of the rectangle represented by the current object.
get_Y() constReturns the Y coordinate of the upper left corner of the rectangle represented by the current object.
GetHashCode() constReturns a hash code of the current object.
Inflate(float, float)Increases the width and height of the rectangle represented by the current object, maintaining the location of the geometrical center of the rectangle. The width and height are increased in both directions by the specified amounts.
Inflate(const SizeF&)Increases the width and height of the rectangle represented by the current object, maintaining the location of the geometrical center of the rectangle. The width and height are increased in both directions by the amounts specified by width and height values of the specified size object correspondingly.
static Inflate(const RectangleF&, float, float)Increases the width and height of the rectangle represented by the specified object, maintaining the location of the geometrical center of the rectangle. The width and height are increased in both directions by the specified amounts.
Intersect(const RectangleF&)Replaces the rectangle represented by the current object with the rectangle that results from the its intersection with the rectangle represented by the specified object.
static Intersect(const RectangleF&, const RectangleF&)Returns a rectangle that is a result of intersection of the specified rectangles.
IntersectsWith(const RectangleF&)Determines if the rectangles represented by the current and specified objects intesect.
Offset(const PointF&)Offsets the position of the rectangle represented by the current object by the specified amounts.
Offset(float, float)Offsets the position of the rectangle represented by the current object by the specified amounts.
operator!=(std::nullptr_t) constAlways returns true.
operator==(std::nullptr_t) constAlways returns false.
RectangleF()Constructs a new instance of RectangleF object that represents a rectangle with X and Y coordinates and width and hegiht values set to 0.
RectangleF(float, float, float, float)Constructs a new instance of RectangleF object that represents a rectangle with the specified coordinates of its upper left corner and width and height.
RectangleF(const PointF&, const SizeF&)Constructs a new instance of RectangleF object that represents a rectangle with the coordinates of its upper left corner specified as an instance of PointF class and its width and height as an instance of SizeF class.
explicit RectangleF(const Rectangle&)Constructs a new instance of RectangleF object that represents the rectangle equivalent to the specified one.
set_Height(float)Sets the height of the rectangle represented by the current object.
set_Location(PointF)Sets the location of the upper left corner of the rectangle represented by the current object.
set_Size(SizeF)Sets the width and height of the rectangle represented by the current object.
set_Width(float)Sets the width of the rectangle represented by the current object.
set_X(float)Sets the X coordinate of the upper left corner of the rectangle represented by the current object.
set_Y(float)Sets the Y coordinate of the upper left corner of the rectangle represented by the current object.
ToString() constReturns the string representation of the current object.
static Union(const RectangleF&, const RectangleF&)Returns a rectangle that is a result of union of the specified rectangles.

Fields

FieldDescription
static EmptyAn empty rectangle i.e. a rectangle whose location and size values have zero values.

See Also