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