ContainerVisual.ContentBounds プロパティ

定義

ContainerVisual のコンテンツの境界ボックスを取得します。

public:
 property System::Windows::Rect ContentBounds { System::Windows::Rect get(); };
public System.Windows.Rect ContentBounds { get; }
member this.ContentBounds : System.Windows.Rect
Public ReadOnly Property ContentBounds As Rect

プロパティ値

Rect

境界ボックスを指定する Rect

次の例は、オブジェクトの外接する四角形を取得する方法を ContainerVisual 示しています。

// Return the bounding rectangle for the ContainerVisual.
Rect rectBounds = containerVisual.ContentBounds;

// Expand the rectangle to include the bounding rectangle
// of the all of the ContainerVisual's descendants.
rectBounds.Union(containerVisual.DescendantBounds);
' Return the bounding rectangle for the ContainerVisual.
Dim rectBounds As Rect = containerVisual.ContentBounds

' Expand the rectangle to include the bounding rectangle
' of the all of the ContainerVisual's descendants.
rectBounds.Union(containerVisual.DescendantBounds)

注釈

このプロパティを DescendantBounds 使用して、オブジェクト自体ではなく、オブジェクトのすべての子孫のすべてのコンテンツ 境界ボックスの ContainerVisual 和集合を返します。

適用対象