Condividi tramite


Metodo ShapeGeometry.GetPath (RectangleD)

Ottiene il percorso attorno alla geometria della forma.

Spazio dei nomi:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.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
Percorso attorno alla geometria della forma.

Note

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

Esempi

Questo esempio è valido per una forma circolare. Si noti che viene utilizzato UninitializedPath e reimposta.

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