CRect Class
Overview
Note
The CRect class handles rectangles
The structure used for this class is CRect
Quick Reference
Quick Ref |
void CRect::CRect(RECT* lpSrcRect) |
int CRect::PtInRect(POINT point) |
int CRect::IntersectRect(RECT* lpRect1, RECT* lpRect2) |
int CRect::IsRectEmpty() |
void CRect::DeflateRect(int l, int t, int r, int b) |
void CRect::InflateRect(int l, int t, int r, int b) |
void CRect::NormalizeRect() |
Constructors
Name |
Description |
Constructs a |
CRect::CRect
Constructs a CRect object
void CRect::CRect(RECT* lpSrcRect);
Parameters
RECT* lpSrcRect -
Remarks
Constructs a CRect object
Methods
Name |
Description |
Determines whether the specified point lies within the rectangle |
|
Intersects two source rectangles into the rectangle |
|
Determines whether the rectangle is empty |
|
Decreases the width and height of the rectangle |
|
Increases the width and height of the rectangle |
|
CRect::PtInRect
Determines whether the specified point lies within the rectangle
int CRect::PtInRect(POINT point);
Parameters
POINT point - x and y coordinates used to determine if within rectangle
Return Value
Returns an int value representing 1 true, or 0 false
Remarks
CRect::IntersectRect
Calculates the intersection of two source rectangles and places the coordinates of the intersection source rectangles into the rectangle
int CRect::IntersectRect(
RECT* lpRect1,
RECT* lpRect2);
Parameters
Return Value
Returns an int value representing 1 true, or 0 false
Remarks
CRect::IsRectEmpty
Determines whether the rectangle is empty
int CRect::IsRectEmpty();
Return Value
Returns an int value representing 1 true, or 0 false
Remarks
CRect::DeflateRect
Decreases the width and height of the rectangle
void CRect::DeflateRect(
int l,
int t,
int r,
int b);
Parameters
intl - amount to decrease left side of rectangleintt - amount to decrease top side of rectangleintr - amount to decrease right side of rectangleintb - amount to decrease bottom side of rectangle
Remarks
The rectangle is adjusted by the amounts specified
CRect::InflateRect
Increases the width and height of the rectangle
void CRect::InflateRect(
int l,
int t,
int r,
int b);
Parameters
intl - amount to increase left side of rectangleintt - amount to increase top side of rectangleintr - amount to increase right side of rectangleintb - amount to increase bottom side of rectangle
Remarks
The rectangle is adjusted by the amounts specified
CRect::NormalizeRect
void CRect::NormalizeRect();
Remarks