Rect::IsEmptyArea method (gdiplustypes.h)

The Rect::IsEmptyArea method determines whether this rectangle is empty.


BOOL IsEmptyArea();

Return value

Type: BOOL

If the rectangle is empty, this method returns TRUE; otherwise, it returns FALSE.


A rectangle is defined as empty if either the width or the height is zero or less.


The following example creates a Rect object, inflates the dimensions of the rectangle, and determines whether the rectangle is empty.

VOID Example_IsEmptyArea(HDC hdc)
   Graphics graphics(hdc);

   // Create a Rect object, and inflate the dimensions.
   Rect rect(50, 50, 200, 100);
   rect.Inflate(0, -120);

   // Determine whether the rectangle is empty.

   // The rectangle does not enclose any area.


Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplustypes.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Inflate Methods

Pens, Lines, and Rectangles



Using a Pen to Draw Lines and Rectangles