共用方式為


CRect::Size

The cx and cy members of the return value contain the height and width of CRect.

CSize Size( ) const throw( );

Return Value

A CSize object that contains the size of CRect.

Remarks

Either the height or width can be negative.

注意

The rectangle must be normalized or this function may fail. You can call NormalizeRect to normalize the rectangle before calling this function.

Example

CRect rect(10, 10, 50, 50);
CSize sz = rect.Size();
ASSERT(sz.cx == 40 && sz.cy == 40);   

Requirements

Header: atltypes.h

See Also

Reference

CRect Class

Hierarchy Chart

CRect::Height

CRect::Width

CRect::IsRectEmpty

CRect::IsRectNull

CRect::NormalizeRect

Other Resources

CRect Members