Export (0) Print
Expand All

Graphics.IsVisible(INT, INT, INT, INT) 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]  INT x,
  [in]  INT y,
  [in]  INT width,
  [in]  INT height
) const;

Parameters

x [in]

Type: INT

Integer that specifies the x-coordinate of the upper-left corner of the rectangle to test.

y [in]

Type: INT

Integer that specifies the y-coordinate of the upper-left corner of the rectangle to test.

width [in]

Type: INT

Integer that specifies the width of the rectangle to test.

height [in]

Type: INT

Integer that specifies the height of the rectangle to test.

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 determines whether the specified rectangle is visible or partially visible on the display device. If it is, it fills the rectangle.


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

   // Set up the coordinates of the rectangle.
   int x = 0;
   int y = 0;
   int width = 100;
   int height = 100;

   // If the rectangle is visible, fill it.
   if (graphics.IsVisible(x, y, width, height))
   {
       graphics.FillRectangle(&SolidBrush(Color(255, 0, 0, 0)), x, y, width, height);
   }
}

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

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2015 Microsoft