Graphics.IsVisible(const RectF&) method

Applies to: desktop apps only

The Graphics::IsVisible method determines whether the specified rectangle intersects the visible clipping region of this Graphics object. The visible clipping region is the intersection of the clipping region of this Graphics object and the clipping region of the window.

Syntax

BOOL IsVisible(
  [in]  const RectF& rect
) const;

Parameters

rect [in]

Type: const RectF&

Reference to a rectangle to be tested to see whether it intersects the visible clipping region.

Return value

Type:

Type: BOOL

If the specified rectangle intersects the visible clipping region, this method returns TRUE; otherwise, it returns FALSE.

Examples

The following example creates a RectF object and determines whether the rectangle is visible or partially visible on the display device. If it is, it fills the rectangle.


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

   // Create a RectF object.
   RectF visibleRect(0.0f, 0.0f, 100.2f, 100.2f);

   // Determine whether the rectangle is visible and, 
   // if it is, fill it.
   if (graphics.IsVisible(visibleRect))
   {
       graphics.FillRectangle(&SolidBrush(Color(255, 0, 0, 0)), visibleRect);
   }
}

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::IsVisibleClipEmpty
RectF

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show: