Partilhar via


Método ShapeGeometry.GetPath (RectangleD)

Obtém o caminho em torno da geometria da forma.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (em Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)

Sintaxe

'Declaração
Protected Overridable Function GetPath ( _
    boundingBox As RectangleD _
) As GraphicsPath
protected virtual GraphicsPath GetPath(
    RectangleD boundingBox
)

Parâmetros

Valor de retorno

Tipo: System.Drawing.Drawing2D.GraphicsPath
O caminho em torno da geometria da forma.

Comentários

Essa propriedade retorna uma referência para o caminho usado por esta geometria. Não a descartado. Use o caminho antes de usar GetPath() novamente. Se você requer uma cópia, use o GetPathCopy.

Exemplos

Este exemplo é para uma maneira circular. Observe que UninitializedPath é usado e redefinido.

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

Segurança do .NET Framework

Consulte também

Referência

ShapeGeometry Classe

Sobrecargas GetPath

Namespace Microsoft.VisualStudio.Modeling.Diagrams