Graphics::IsVisible(INT,INT) method (gdiplusgraphics.h)

The Graphics::IsVisible method determines whether the specified point is inside 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(
  INT x,
  INT y
);

Parameters

x

Integer that specifies the x-coordinate of the point to test.

y

Integer that specifies the y-coordinate of the point to test.

Return value

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Remarks

Examples

The following example tests whether the specified point is visible on the display device. If it is, it fills an ellipse that represents that point.

VOID Example_IsVisible5(HDC hdc)

{
   Graphics graphics(hdc);

   // Set up the coordinates of the point.
   int x = 100;
   int y = 100;

   // If the point (x, y) is visible, fill an ellipse that represents it.
   if (graphics.IsVisible(x, y))
   {
   graphics.FillEllipse(&SolidBrush(Color(255, 0, 0, 0)), x, y, 5, 5);
   }
}

Requirements

Requirement Value
Header gdiplusgraphics.h

See also

Graphics

Graphics::IsVisibleClipEmpty