Share via


CRect::IsRectEmpty

Determines whether CRect is empty.

BOOL IsRectEmpty( ) const throw( );

Return Value

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

Remarks

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.

Note

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

Example

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());   

Requirements

Header: atltypes.h

See Also

Reference

CRect Class

Hierarchy Chart

CRect::IsRectNull

CRect::SetRectEmpty

CRect::NormalizeRect

IsRectEmpty