Export (0) Print
Expand All

CRect::IsRectEmpty

Determines whether CRect is empty.

BOOL IsRectEmpty( ) const throw( );

Nonzero if CRect is empty; 0 if CRect is not empty.

A rectangle is empty if the width and/or height are 0 or negative. Differs from IsRectNull, which determines whether all coordinates of the rectangle are zero.

NoteNote:

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

CRect rectNone(0, 0, 0, 0);
CRect rectSome(35, 50, 135, 150);

ASSERT(rectNone.IsRectEmpty());
ASSERT(!rectSome.IsRectEmpty());

CRect rectEmpty(35, 35, 35, 35);
ASSERT(rectEmpty.IsRectEmpty());   

Header: atltypes.h

Community Additions

ADD
Show:
© 2015 Microsoft