CRect::SetRect
This method sets the dimensions of a CRect object to the specified coordinates.
void SetRect(
int x1,
int y1,
int x2,
int y2 );
void SetRect(
Point topLeft,
POINT bottomRight );
Parameters
x1
Specifies the x-coordinate of the upper-left corner.
y1
Specifies the y-coordinate of the upper-left corner.
x2
Specifies the x-coordinate of the lower-right corner.
y2
Specifies the y-coordinate of the lower-right corner.
topLeft
The coordinates of the top-left corner of the rectangle.
bottomRight
The coordinates of the bottom-right corner of the rectangle.
Example
CRect rect;
rect.SetRect(256, 256, 512, 512);
ASSERT(rect == CRect(256, 256, 512, 512));
This method sets the dimensions of a CRect object to the specified coordinates.
void SetRect(
int x1,
int y1,
int x2,
int y2 );
void SetRect(
Point topLeft,
POINT bottomRight );
Parameters
x1
Specifies the x-coordinate of the upper-left corner.
y1
Specifies the y-coordinate of the upper-left corner.
x2
Specifies the x-coordinate of the lower-right corner.
y2
Specifies the y-coordinate of the lower-right corner.
topLeft
The coordinates of the top-left corner of the rectangle.
bottomRight
The coordinates of the bottom-right corner of the rectangle.
Example
CRect rect;
rect.SetRect(256, 256, 512, 512);
ASSERT(rect == CRect(256, 256, 512, 512));