Public Member Functions

 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. More...
 
 RectangleF (float x, float y, float width, float height)
 
 RectangleF (const PointF &location, const SizeF &size)
 
 RectangleF (const Rectangle &rect)
 
PointF get_Location () const
 
void set_Location (PointF value)
 
SizeF get_Size () const
 
void set_Size (SizeF value)
 
float get_X () const
 Returns the X coordinate of the upper left corner of the rectangle represented by the current object. More...
 
void set_X (float value)
 
float get_Y () const
 Returns the Y coordinate of the upper left corner of the rectangle represented by the current object. More...
 
void set_Y (float value)
 
float get_Width () const
 Returns the width of the rectangle represented by the current object. More...
 
void set_Width (float value)
 
float get_Height () const
 Returns the height of the rectangle represented by the current object. More...
 
void set_Height (float value)
 
float get_Left () const
 Returns the X coordinate of the left edge of the rectangle represented by the current object. More...
 
float get_Top () const
 Returns the Y coordinate of the top edge of the rectangle represented by the current object. More...
 
float get_Right () const
 Returns the X coordinate of the right edge of the rectangle represented by the current object. More...
 
float get_Bottom () const
 Returns the y coordinate of the bottom edge of the rectangle represented by the current object. More...
 
bool get_IsEmpty () const
 
bool Equals (const RectangleF &rect) const
 
bool Contains (float x, float y)
 
bool Contains (const PointF &point)
 
bool Contains (const RectangleF &rect)
 
void Inflate (float width, float height)
 
void Inflate (const SizeF &size)
 
void Intersect (const RectangleF &rect)
 
bool IntersectsWith (const RectangleF &rect)
 
void Offset (const PointF &pos)
 
void Offset (float x, float y)
 
bool operator== (std::nullptr_t) const
 Always returns false. More...
 
bool operator!= (std::nullptr_t) const
 Always returns true. More...
 
int GetHashCode () const
 Returns a hash code of the current object. More...
 
System::String ToString () const
 Returns the string representation of the current object. More...
 

Static Public Member Functions

static RectangleF FromLTRB (float left, float top, float right, float bottom)
 
static RectangleF Inflate (const RectangleF &rect, float x, float y)
 
static RectangleF Intersect (const RectangleF &a, const RectangleF &b)
 
static RectangleF Union (const RectangleF &a, const RectangleF &b)
 

Static Public Attributes

static const RectangleF Empty
 An empty rectangle i.e. a rectangle whose location and size values have zero values. More...
 

Friends

bool operator== (const RectangleF &rect1, const RectangleF &rect2)
 
bool operator!= (const RectangleF &rect1, const RectangleF &rect2)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RectangleF() [1/4]

System::Drawing::RectangleF::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() [2/4]

System::Drawing::RectangleF::RectangleF ( float  x,
float  y,
float  width,
float  height 
)

Constructs a new instance of RectangleF object that represents a rectangle with the specified coordinates of its upper left corner and width and height.

Parameters
xA value of the X coordinate of the upper left corner of the rectangle
yA value of the Y coordinate of the upper left corner of the rectangle
widthThe width of the rectangle
heightThe height of the rectangle

◆ RectangleF() [3/4]

System::Drawing::RectangleF::RectangleF ( const PointF location,
const SizeF size 
)

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.

Parameters
locationSpecifies the location of the upper left corner of the rectangle
sizeSpecifies the width and hegiht of the rectangle

◆ RectangleF() [4/4]

System::Drawing::RectangleF::RectangleF ( const Rectangle rect)
explicit

Constructs a new instance of RectangleF object that represents the rectangle equivalent to the specified one.

Parameters
rectAn instance of Rectangle class that specifies the position and size of the rectangle to be represented by the object being constructed

Member Function Documentation

◆ Contains() [1/3]

bool System::Drawing::RectangleF::Contains ( float  x,
float  y 
)

Determines if the specified point is located within the rectangle represented by the current object.

Parameters
xThe X coordinate of the point to check
yThe Y coordinate of the point to check
Returns
True if the specified point is located within the rectangle represented by the current object, otherwise - false

◆ Contains() [2/3]

bool System::Drawing::RectangleF::Contains ( const PointF point)

Determines if the specified point is located within the rectangle represented by the current object.

Parameters
pointA point to check
Returns
True if the specified point is located within the rectangle represented by the current object, otherwise - false

◆ Contains() [3/3]

bool System::Drawing::RectangleF::Contains ( const RectangleF rect)

Determines if the specified rectangle is located within the rectangle represented by the current object.

Parameters
rectA rectangle to check
Returns
True if the specified rectangle is located within the rectangle represented by the current object, otherwise - false

◆ Equals()

bool System::Drawing::RectangleF::Equals ( const RectangleF rect) const

Determines if the rectangles represented by the current and the specified objects are identical.

Parameters
rectThe RectangleF object to compare the current object with
Returns
True if the rectangles represented by the current and the specified objects are identical, otherwise - false

◆ FromLTRB()

static RectangleF System::Drawing::RectangleF::FromLTRB ( float  left,
float  top,
float  right,
float  bottom 
)
inlinestatic

Constructs a new RectangleF object that represents a rectangle with the specified edge locations.

Parameters
leftThe X coordinate of the left edge of the rectangle
topThe Y coordinate of the top edge of the rectangle
rightThe X coordinate of the right edge of the rectangle
bottomThe Y coordinate of the bottom edge of the rectangle
Returns
An instance of RectangleF class that represents the speified rectangle

◆ get_Bottom()

float System::Drawing::RectangleF::get_Bottom ( ) const
inline

Returns the y coordinate of the bottom edge of the rectangle represented by the current object.

◆ get_Height()

float System::Drawing::RectangleF::get_Height ( ) const
inline

Returns the height of the rectangle represented by the current object.

◆ get_IsEmpty()

bool System::Drawing::RectangleF::get_IsEmpty ( ) const
inline

Determines 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.

Returns
True 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, otherwise - false

◆ get_Left()

float System::Drawing::RectangleF::get_Left ( ) const
inline

Returns the X coordinate of the left edge of the rectangle represented by the current object.

◆ get_Location()

PointF System::Drawing::RectangleF::get_Location ( ) const
inline

Returns 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()

float System::Drawing::RectangleF::get_Right ( ) const
inline

Returns the X coordinate of the right edge of the rectangle represented by the current object.

◆ get_Size()

SizeF System::Drawing::RectangleF::get_Size ( ) const
inline

Returns an instance of the SizeF class that specifies the width and height of the rectangle represented by the current object.

◆ get_Top()

float System::Drawing::RectangleF::get_Top ( ) const
inline

Returns the Y coordinate of the top edge of the rectangle represented by the current object.

◆ get_Width()

float System::Drawing::RectangleF::get_Width ( ) const
inline

Returns the width of the rectangle represented by the current object.

◆ get_X()

float System::Drawing::RectangleF::get_X ( ) const
inline

Returns the X coordinate of the upper left corner of the rectangle represented by the current object.

◆ get_Y()

float System::Drawing::RectangleF::get_Y ( ) const
inline

Returns the Y coordinate of the upper left corner of the rectangle represented by the current object.

◆ GetHashCode()

int System::Drawing::RectangleF::GetHashCode ( ) const

Returns a hash code of the current object.

◆ Inflate() [1/3]

void System::Drawing::RectangleF::Inflate ( float  width,
float  height 
)

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.

Parameters
widthThe amount by which the width of the rectangle is to be increased in both directions
heightThe amount by which the height of the rectangle is to be increased in both directions

◆ Inflate() [2/3]

void System::Drawing::RectangleF::Inflate ( const SizeF size)

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.

Parameters
sizeThe SizeF object specifying the amounts to increase the width and height of the rectangle by

◆ Inflate() [3/3]

static RectangleF System::Drawing::RectangleF::Inflate ( const RectangleF rect,
float  x,
float  y 
)
static

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.

Parameters
rectA rectangle to inflate
xThe amount by which the width of the rectangle is to be increased in both directions
yThe amount by which the height of the rectangle is to be increased in both directions
Returns
The RectangleF object representing the enlarged rectangle

◆ Intersect() [1/2]

void System::Drawing::RectangleF::Intersect ( const RectangleF rect)

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.

Parameters
rectThe RectangleF object that represents the rectangle to intersect the rectangle represented by the current object with

◆ Intersect() [2/2]

static RectangleF System::Drawing::RectangleF::Intersect ( const RectangleF a,
const RectangleF b 
)
static

Returns a rectangle that is a result of intersection of the specified rectangles.

Parameters
aThe first rectangle to intersect
bThe second rectangle to intersect
Returns
The result of intersection of a with b

◆ IntersectsWith()

bool System::Drawing::RectangleF::IntersectsWith ( const RectangleF rect)

Determines if the rectangles represented by the current and specified objects intesect.

Parameters
rectThe rectangle to check
Returns
True if the rectangles represented by the current object and rect intersect, otherwise - false

◆ Offset() [1/2]

void System::Drawing::RectangleF::Offset ( const PointF pos)

Offsets the position of the rectangle represented by the current object by the specified amounts.

Parameters
posThe PointF object that specifies the amount by which the rectangle is offset; the point's X coordinat value specifies the amount to add to the X coordinate of the upper left corner of the rectangle and the point's Y coordinate specifies the amount to add to the Y coordinate of the upper left corner of the rectangle

◆ Offset() [2/2]

void System::Drawing::RectangleF::Offset ( float  x,
float  y 
)

Offsets the position of the rectangle represented by the current object by the specified amounts.

Parameters
xThe value to add to the current X coordinate of the rectangle
yThe value to add to the current Y coordinate of the rectangle

◆ operator!=()

bool System::Drawing::RectangleF::operator!= ( std::nullptr_t  ) const
inline

Always returns true.

◆ operator==()

bool System::Drawing::RectangleF::operator== ( std::nullptr_t  ) const
inline

Always returns false.

◆ set_Height()

void System::Drawing::RectangleF::set_Height ( float  value)
inline

Sets the height of the rectangle represented by the current object.

Parameters
valueThe value to set

◆ set_Location()

void System::Drawing::RectangleF::set_Location ( PointF  value)
inline

Sets the location of the upper left corner of the rectangle represented by the current object.

Parameters
valueThe value to set

◆ set_Size()

void System::Drawing::RectangleF::set_Size ( SizeF  value)
inline

Sets the width and height of the rectangle represented by the current object.

Parameters
valueAn instance of SizeF class specifying the width and height values to set

◆ set_Width()

void System::Drawing::RectangleF::set_Width ( float  value)
inline

Sets the width of the rectangle represented by the current object.

Parameters
valueThe value to set

◆ set_X()

void System::Drawing::RectangleF::set_X ( float  value)
inline

Sets the X coordinate of the upper left corner of the rectangle represented by the current object.

Parameters
valueThe value to set

◆ set_Y()

void System::Drawing::RectangleF::set_Y ( float  value)
inline

Sets the Y coordinate of the upper left corner of the rectangle represented by the current object.

Parameters
valueThe value to set

◆ ToString()

System::String System::Drawing::RectangleF::ToString ( ) const
inline

Returns the string representation of the current object.

◆ Union()

static RectangleF System::Drawing::RectangleF::Union ( const RectangleF a,
const RectangleF b 
)
static

Returns a rectangle that is a result of union of the specified rectangles.

Parameters
aThe first rectangle to union
bThe second rectangle to union
Returns
The result of union of a with b

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const RectangleF rect1,
const RectangleF rect2 
)
friend

Determines if the rectangles represented by the specified objects are not identical.

Parameters
rect1The first rectangle to compare
rect2The second rectangle to compare
Returns
True if the rectangles represented by rect1 and rect2 are not identical, otherwise - false

◆ operator==

bool operator== ( const RectangleF rect1,
const RectangleF rect2 
)
friend

Determines if the rectangles represented by the specified objects are identical.

Parameters
rect1The first rectangle to compare
rect2The second rectangle to compare
Returns
True if the rectangles represented by rect1 and rect2 are identical, otherwise - false

Member Data Documentation

◆ Empty

const RectangleF System::Drawing::RectangleF::Empty
static

An empty rectangle i.e. a rectangle whose location and size values have zero values.