Condividi tramite


Metodo ShapeGeometry.GetPath (RectangleD)

Ottiene il percorso intorno alla geometria della forma.

Spazio dei nomi:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll)

Sintassi

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

Parametri

Valore restituito

Tipo: System.Drawing.Drawing2D.GraphicsPath
Il percorso intorno alla geometria della forma.

Note

Questa proprietà restituisce un riferimento al percorso utilizzato dalla geometria.non eliminarlo.utilizzare il percorso prima di utilizzare GetPath() ancora.Se è necessaria una copia, utilizzare GetPathCopy.

Esempi

Questo esempio è valido per una forma circolare.Notare che UninitializedPath viene utilizzato e reimpostazione.

/// <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;
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

ShapeGeometry Classe

Overload GetPath

Spazio dei nomi Microsoft.VisualStudio.Modeling.Diagrams