RectF class
Applies to: desktop apps only
A RectF object stores the upper-left corner, width, and height of a rectangle.
RectF has these types of members:
Constructors
The RectF class has these constructors.
Constructor | Description |
---|---|
RectF::RectF() |
Creates a RectF object and initializes the X and Y data members to zero. This is the default constructor. |
RectF::RectF(PointF&,SizeF&) |
Creates a RectF object by using a PointF object to initialize the X and Y data members and uses a SizeF object to initialize the Width and Height data members of this rectangle. |
RectF::RectF(REAL,REAL,REAL,REAL) |
Creates a RectF object by using four integers to initialize the X, Y, Width, and Height data members. |
Methods
The RectF class has these methods.
Method | Description |
---|---|
RectF::Clone |
The RectF::Clone method creates a new RectF object and initializes it with the contents of this RectF object. |
RectF::Contains(PointF&) |
The RectF::Contains method determines whether a point is inside this rectangle. |
RectF::Contains(REAL,REAL) |
The RectF::Contains method determines whether the point (x, y) is inside this rectangle. |
RectF::Contains(RectF&) |
The RectF::Contains method determines whether another rectangle is inside this rectangle. |
RectF::Equals |
The RectF::Equals method determines whether two rectangles are the same. |
RectF::GetBottom |
The RectF::GetBottom method gets the y-coordinate of the bottom edge of the rectangle. |
RectF::GetBounds |
The RectF::GetBounds method makes a copy of this rectangle. |
RectF::GetLeft |
The RectF::GetLeft method gets the x-coordinate of the left edge of the rectangle. |
RectF::GetLocation |
The RectF::GetLocation method gets the coordinates of the upper-left corner of this rectangle. |
RectF::GetRight |
The RectF::GetRight method gets the x-coordinate of the right edge of the rectangle. |
RectF::GetSize |
The RectF::GetSize method gets the width and height of this rectangle. |
RectF::GetTop |
The RectF::GetTop method gets the y-coordinate of the top edge of the rectangle. |
RectF::Inflate(PointF&) |
The RectF::Inflate method expands the rectangle by the value of point.X on the left and right edges, and by the value of point.Y on the top and bottom edges. |
RectF::Inflate(REAL,REAL) |
The RectF::Inflate method expands the rectangle by dx on the left and right edges, and by dy on the top and bottom edges. |
RectF::Intersect(RectF&) |
The RectF::Intersect method replaces this rectangle with the intersection of itself and another rectangle. |
RectF::Intersect(RectF&,RectF&,RectF&) |
The RectF::Intersect method determines the intersection of two rectangles and stores the result in a RectF object. |
RectF::IntersectsWith |
The RectF::IntersectsWith method determines whether this rectangle intersects another rectangle. |
RectF::IsEmptyArea |
The RectF::IsEmptyArea method determines whether this rectangle is empty. |
RectF::Offset(PointF&) |
The RectF::Offset method moves this rectangle horizontally a distance of point.X and vertically a distance of point.Y. |
RectF::Offset(REAL,REAL) |
The RectF::Offset method moves the rectangle by dx horizontally and by dx vertically. |
RectF::Union |
The RectF::Union method determines the union of two rectangles and stores the result in a RectF object. |
Data Members
The following table lists the members exposed by the RectF object.
Data Members | Type | Description |
---|---|---|
X | REAL | X-coordinate of the upper-left corner of the rectangle. |
Y | REAL | Y-coordinate of the upper-left corner of the rectangle. |
Width | REAL | Width of the rectangle. |
Height | REAL | Height of the rectangle. |
Remarks
The upper-left corner of the rectangle is located at ( x, y). The size of the rectangle is measured by width and height. There are methods for high-level functionality, such as moving, resizing, and performing or testing interactions with other rectangles.
Send comments about this topic to Microsoft
Build date: 3/6/2012