次の方法で共有


ShapeGeometry.GetPath メソッド (RectangleD)

図形ジオメトリの周囲のパスを取得します。

名前空間:  Microsoft.VisualStudio.Modeling.Diagrams
アセンブリ:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll 内)

構文

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

パラメーター

戻り値

型 : System.Drawing.Drawing2D.GraphicsPath
図形ジオメトリの周囲のパス。

解説

このプロパティは、このジオメトリによって使用されるパスへの参照を返します。 これを破棄せずにします。 GetPath() を使用する前にパスを使用します。 コピーが必要な場合は、GetPathCopyを使用します。

この例では、円図形の場合です。 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;
}

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

ShapeGeometry クラス

GetPath オーバーロード

Microsoft.VisualStudio.Modeling.Diagrams 名前空間