###### CRect
CRect::CRect

CRect( ) throw( );
CRect(
int l,
int t,
int r,
int b
) throw( );
CRect(
const RECT& srcRect
) throw( );
CRect(
LPCRECT lpSrcRect
) throw( );
CRect(
POINT point,
SIZE size
) throw( );
CRect(
POINT topLeft,
POINT bottomRight
) throw( );

l

t

r

b

srcRect

lpSrcRect

point

size

topLeft

bottomRight

CRectconst RECT& )和 CRectLPCRECT )构造函数执行 CopyRect。 其他构造函数直接初始化对象的成员变量。


// default constructor doesn't initialize!
CRect rectUnknown;

// four-integers are left, top, right, and bottom
CRect rect(0, 0, 100, 50);
ASSERT(rect.Width() == 100);
ASSERT(rect.Height() == 50);

// Initialize from RECT stucture
RECT sdkRect;
sdkRect.left = 0;
sdkRect.top = 0;
sdkRect.right = 100;
sdkRect.bottom = 50;

CRect rect2(sdkRect);   // by reference
ASSERT(rect2 == rect);
ASSERT(rect3 == rect);

// from a point and a size
CPoint pt(0, 0);
CSize sz(100, 50);
CRect rect4(pt, sz);
ASSERT(rect4 == rect2);

// from two points
CPoint ptBottomRight(100, 50);
CRect rect5(pt, ptBottomRight);
ASSERT(rect5 == rect4);   

#### CRect类

2014-03-17 17:08:27

#### CRect类 的介绍

2014-03-03 15:18:06

#### VC++----CRect类

2012-08-04 19:25:06

#### CRect::DeflateRect() 压缩矩形

2012-05-23 13:25:46

#### MFC中CRect和opencv中CvRect的区别

2014-02-14 14:52:02

#### CRect::DeflateRect() 和OffsetRect()

2014-05-23 21:05:56

#### CRect::IntersectRect的功能

2013-09-03 15:46:14

#### VC++ CRect类说明

2012-08-15 14:09:21

#### MFC：判断点（POINT）是否在某一区域(CRect)

2015-06-04 18:22:03

#### MFC类CRect、CPoint、CSize

2014-03-07 17:21:33

CRect