Export (0) Print
Expand All
Expand Minimize

Graphics.IsClipEmpty method

Applies to: desktop apps only

The Graphics::IsClipEmpty method determines whether the clipping region of this Graphics object is empty.

Syntax

BOOL IsClipEmpty() const;

Parameters

This method has no parameters.

Return value

Type:

Type: BOOL

If the clipping region of a Graphics object is empty, this method returns TRUE; otherwise, it returns FALSE.

Remarks

If the clipping region of a Graphics object is empty, there is no area left in which to draw. Consequently, nothing will be drawn when the clipping region is empty.

Examples

The following example determines whether the clipping region is empty and, if it isn't, draws a rectangle.


VOID Example_IsClipEmpty(HDC hdc)
{
   Graphics graphics(hdc);

   // If the clipping region is not empty, draw a rectangle.
   if (!graphics.IsClipEmpty())
   {
   graphics.DrawRectangle(&Pen(Color(255, 0, 0, 0), 3), 0, 0, 100, 100);
   }
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics
Graphics::GetClip
GetClipBounds Methods
Graphics::IsVisibleClipEmpty
Region
Graphics::ResetClip
SetClip Methods
Clipping with a Region
Clipping

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2014 Microsoft