Rect Class

A Rect object stores the upper-left corner, width, and height of a rectangle.

Rect has these types of members:

Constructors

The Rect class has these constructors.
Constructor Description
Rect::Rect() Creates a Rect object whose x-coordinate, y-coordinate, width, and height are all zero. This is the default constructor.
Rect::Rect(INT,INT,INT,INT) Creates a Rect object by using four integers to initialize the X, Y, Width, and Height data members.
Rect::Rect(Point&,Size&) Creates a Rect object by using a Point object to initialize the X and Y data members and a Size object to initialize the Width and Height data members.
 

Methods

The Rect class has these methods.
Method Description
Rect::Clone The Rect::Clone method creates a new Rect object and initializes it with the contents of this Rect object.
Rect::Contains(INT,INT) The Rect::Contains method determines whether the point ( x, y) is inside this rectangle.
Rect::Contains(Point&) The Rect::Contains method determines whether a point is inside this rectangle.
Rect::Contains(Rect&) The Rect::Contains method determines whether another rectangle is inside this rectangle.
Rect::Equals The Rect::Equals method determines whether two rectangles are the same.
Rect::GetBottom The Rect::GetBottom method gets the y-coordinate of the bottom edge of the rectangle.
Rect::GetBounds The Rect::GetBounds method makes a copy of this rectangle.
Rect::GetLeft The Rect::GetLeft method gets the x-coordinate of the left edge of the rectangle.
Rect::GetLocation The Rect::GetLocation method gets the coordinates of the upper-left corner of the rectangle.
Rect::GetRight The Rect::GetRight method gets the x-coordinate of the right edge of the rectangle.
Rect::GetSize The Rect::GetSize method gets the width and height of the rectangle.
Rect::GetTop The Rect::GetTop method gets the y-coordinate of the top edge of the rectangle.
Rect::Inflate(INT,INT) The Rect::Inflate method expands the rectangle by dx on the left and right edges, and by dy on the top and bottom edges.
Rect::Inflate(Point&) The Rect::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.
Rect::Intersect(Rect&) The Rect::Intersect method replaces this rectangle with the intersection of itself and another rectangle.
Rect::Intersect(Rect&,Rect&,Rect&) The Rect::Intersect method determines the intersection of two rectangles and stores the result in a Rect object.
Rect::IntersectsWith The Rect::IntersectsWith method determines whether this rectangle intersects another rectangle.
Rect::IsEmptyArea The Rect::IsEmptyArea method determines whether this rectangle is empty.
Rect::Offset(INT,INT) The Rect::Offset method moves the rectangle by dx horizontally and by dy vertically.
Rect::Offset(Point&) The Rect::Offset method moves this rectangle horizontally a distance of point.X and vertically a distance of point.Y.
Rect::Union The Rect::Union method determines the union of two rectangles and stores the result in a Rect object.

Methods

The Rect class has these methods.

Method Description
Rect::Clone The Rect::Clone method creates a new Rect object and initializes it with the contents of this Rect object.
Rect::Contains This topic lists the Contains methods of the Rect class. For a complete list of methods for the Rect class, see Rect Methods.
Rect::Contains The Rect::Contains method determines whether a point is inside this rectangle.
Rect::Contains This topic lists the Contains methods of the Rect class. For a complete list of methods for the Rect class, see Rect Methods.
Rect::Equals The Rect::Equals method determines whether two rectangles are the same.
Rect::GetBottom The Rect::GetBottom method gets the y-coordinate of the bottom edge of the rectangle.
Rect::GetBounds The Rect::GetBounds method makes a copy of this rectangle.
Rect::GetLeft The Rect::GetLeft method gets the x-coordinate of the left edge of the rectangle.
Rect::GetLocation The Rect::GetLocation method gets the coordinates of the upper-left corner of the rectangle.
Rect::GetRight The Rect::GetRight method gets the x-coordinate of the right edge of the rectangle.
Rect::GetSize The Rect::GetSize method gets the width and height of the rectangle.
Rect::GetTop The Rect::GetTop method gets the y-coordinate of the top edge of the rectangle.
Rect::Inflate This topic lists the Inflate methods of the Rect class. For a complete list of methods for the Rect class, see Rect Methods.
Rect::Inflate The Rect::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.
Rect::Intersect This topic lists the Intersect methods of the Rect class. For a complete list of methods for the Rect class, see Rect Methods.
Rect::Intersect The Rect::Intersect method determines the intersection of two rectangles and stores the result in a Rect object.
Rect::IntersectsWith The Rect::IntersectsWith method determines whether this rectangle intersects another rectangle.
Rect::IsEmptyArea The Rect::IsEmptyArea method determines whether this rectangle is empty.
Rect::Offset This topic lists the Offset methods of the Rect class. For a complete list of methods for the Rect class, see Rect Methods.
Rect::Offset The Rect::Offset method moves the rectangle by dx horizontally and by dy vertically.
Rect::Rect Creates a Rect object whose x-coordinate, y-coordinate, width, and height are all zero. This is the default constructor.
Rect::Rect Creates a Rect object by using four integers to initialize the X, Y, Width, and Height data members.
Rect::Rect Creates a Rect object by using a Point object to initialize the X and Y data members and a Size object to initialize the Width and Height data members.
Rect::Union The Rect::Union method determines the union of two rectangles and stores the result in a Rect object.

Requirements

   
Target Platform Windows
Header gdiplustypes.h