Udostępnij za pośrednictwem


Metoda ShapeGeometry.GetPath — (RectangleD)

Pobiera ścieżki wokół geometrii kształtu.

Przestrzeń nazw:  Microsoft.VisualStudio.Modeling.Diagrams
Zestaw:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (w Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll)

Składnia

'Deklaracja
Protected Overridable Function GetPath ( _
    boundingBox As RectangleD _
) As GraphicsPath
protected virtual GraphicsPath GetPath(
    RectangleD boundingBox
)

Parametry

Wartość zwracana

Typ: System.Drawing.Drawing2D.GraphicsPath
Ścieżki wokół geometrii kształtu.

Uwagi

Właściwość ta zwraca odwołanie do ścieżki używanej przez ten geometrii.Nie usuwaj go.Przed użyciem należy użyć ścieżki GetPath() ponownie.Jeśli kopia jest wymagane, użyć GetPathCopy.

Przykłady

W tym przykładzie jest okrągły kształt.Warto zauważyć, że UninitializedPath jest używana i resetowania.

/// <summary>
/// Gets the GraphicsPath of the geometry.
/// Returns a reference to the path - do not dispose it.
/// </summary>
/// <param name="boundingBox">The bounding box of the shape.</param>
/// <returns>The GraphicsPath of the geometry.</returns>
protected override GraphicsPath GetPath(RectangleD boundingBox)
{
GraphicsPath path = UninitializedPath;
path.Reset();

path.AddEllipse((float)boundingBox.X, (float)boundingBox.Y, (float)boundingBox.Width, (float)boundingBox.Height);
return path;
}

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

ShapeGeometry Klasa

Przeciążenie GetPath

Przestrzeń nazw Microsoft.VisualStudio.Modeling.Diagrams