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

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

Syntax

BOOL IsVisible(
  [in, ref] const Point &  point,
  [in]      const Graphics *g
);

Parameter

[in, ref] point

Typ: const Point

Verweis auf einen zu testenden Punkt.

[in] g

Typ: const Graphics*

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: BOOL

Wenn sich der Punkt in dieser Region befindet, gibt diese Methode TRUE zurück. Andernfalls wird FALSE zurückgegeben.

Hinweise

Hinweis Eine Region enthält ihren Rahmen.
 

Beispiele

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

VOID Example_IsVisiblePoint(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 a point is in the region.
   Point testPoint(125, 30);

   if(pathRegion.IsVisible(testPoint, &graphics))
   {
      // The test point is in the region.
   }

   // Fill a small circle centered at the test point.
   SolidBrush brush(Color(255, 0, 0, 0));
   graphics.FillEllipse(&brush, testPoint.X - 4, testPoint.Y - 4, 8, 8);
}

Anforderungen

Anforderung Wert
Unterstützte Mindestversion (Client) Windows XP, Windows 2000 Professional [nur Desktop-Apps]
Unterstützte Mindestversion (Server) Windows 2000 Server [nur Desktop-Apps]
Zielplattform Windows
Kopfzeile gdiplusheaders.h (include Gdiplus.h)
Bibliothek Gdiplus.lib
DLL Gdiplus.dll

Weitere Informationen

Grafiken

Point

Region

Status