次の方法で共有


ShapeGeometry.GetPath メソッド

保護されたメンバーを含める
継承されたメンバーを含める

図形ジオメトリの周囲のパスを取得します。 他の図形に GetPath() を適用する前に、返されたパスを使用します。 パスを保持する場合は、GetPathCopy() を使用します。

このメンバーはオーバーロードされます。構文、使用方法、例など、このメンバーの詳細については、オーバーロード リストで名前をクリックしてください。

オーバーロードの一覧 

  名前 説明
パブリック メソッド GetPath(IGeometryHost) 図形ジオメトリの周囲のパスを取得します。他の図形に GetPath() を適用する前に、返されたパスを使用します。パスを保持する場合は、GetPathCopy() を使用します。
プロテクト メソッド GetPath(RectangleD) 図形ジオメトリの周囲のパスを取得します。

このページのトップへ

この例では、円図形の場合です。 UninitializedPath が使用され、リセットされることに注意してください。

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

参照

関連項目

ShapeGeometry クラス

Microsoft.VisualStudio.Modeling.Diagrams 名前空間