Region::IsVisible(INT,INT,constGraphics*)-Methode (gdiplusheaders.h)

Die Region::IsVisible-Methode bestimmt, ob sich ein Punkt innerhalb dieser Region befindet.

Syntax

BOOL IsVisible(
  INT            x,
  INT            y,
  const Graphics *g
);

Parameter

x

Ganzzahl, die die x-Koordinate des zu testenden Punkts angibt.

y

Ganzzahl, die die y-Koordinate des zu testenden Punkts angibt.

g

Optional. Zeiger auf ein Graphics-Objekt , das die Welt- und Seitentransformationen enthält, die zum Berechnen der Gerätekoordinaten dieser Region und des Punkts erforderlich sind. Der Standardwert ist NULL.

Rückgabewert

Typ: Status

Wenn die Methode erfolgreich ist, gibt sie OK zurück, ein Element der Status-Enumeration .

Wenn die Methode fehlschlägt, gibt sie eines der anderen Elemente der Status-Enumeration zurück.

Bemerkungen

Beispiele

Im folgenden Beispiel wird eine Region aus einem Pfad erstellt und anschließend getestet, ob sich ein Punkt innerhalb der Region befindet.

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

   Point points[] = {
      Point(110, 20),
      Point(120, 30),
      Point(100, 60),
      Point(120, 70),
      Point(150, 60),
      Point(140, 10)};

   GraphicsPath path;
   SolidBrush solidBrush(Color(255, 255, 0, 0));

   path.AddClosedCurve(points, 6);

   // Create a region from a path.
   Region pathRegion(&path);
   graphics.FillRegion(&solidBrush, &pathRegion);

   // Check to see whether the point (125, 40) is in the region.
   INT x = 125;
   INT y = 40;
   if(pathRegion.IsVisible(x, y, &graphics))
   {

      // The point is in the region.
   }

   // Fill a small circle centered at the point (125, 40).
   SolidBrush brush(Color(255, 0, 0, 0));
   graphics.FillEllipse(&brush, x - 4, y - 4, 8, 8);
}

Requirements (Anforderungen)

   
Kopfzeile gdiplusheaders.h

Weitere Informationen

Region

Rect

Status