VisualTreeHelper.GetContentBounds 方法

定義

傳回 Visual 的快取周框方塊矩形。

多載

GetContentBounds(Visual3D)

傳回指定之 Visual3D 的快取周框方塊矩形。

GetContentBounds(Visual)

傳回指定之 Visual 的快取周框方塊矩形。

GetContentBounds(Visual3D)

傳回指定之 Visual3D 的快取周框方塊矩形。

public:
 static System::Windows::Media::Media3D::Rect3D GetContentBounds(System::Windows::Media::Media3D::Visual3D ^ reference);
public static System.Windows.Media.Media3D.Rect3D GetContentBounds (System.Windows.Media.Media3D.Visual3D reference);
static member GetContentBounds : System.Windows.Media.Media3D.Visual3D -> System.Windows.Media.Media3D.Rect3D
Public Shared Function GetContentBounds (reference As Visual3D) As Rect3D

參數

reference
Visual3D

要計算其周框方塊值的 3D 視覺物件。

傳回

Rect3D

Visual3D 的周框方塊 3D 矩形。

備註

GetDescendantBounds使用 方法可傳回 3D 視覺物件之所有子系之所有內容周框方塊的聯集,其中包含 Visual3D 本身。

另請參閱

適用於

GetContentBounds(Visual)

傳回指定之 Visual 的快取周框方塊矩形。

public:
 static System::Windows::Rect GetContentBounds(System::Windows::Media::Visual ^ reference);
public static System.Windows.Rect GetContentBounds (System.Windows.Media.Visual reference);
static member GetContentBounds : System.Windows.Media.Visual -> System.Windows.Rect
Public Shared Function GetContentBounds (reference As Visual) As Rect

參數

reference
Visual

要計算其周框方塊值的 Visual

傳回

Rect

Visual 的周框方塊矩形。

範例

下列範例示範如何擷取 物件的周框 Visual

// Return the bounding rectangle of the parent visual object and all of its descendants.
Rect rectBounds = VisualTreeHelper.GetDescendantBounds(parentVisual);
' Return the bounding rectangle of the parent visual object and all of its descendants.
Dim rectBounds As Rect = VisualTreeHelper.GetDescendantBounds(parentVisual)

備註

GetDescendantBounds呼叫 方法,以傳回包含本身之視覺物件 Visual 之所有子系之所有內容周框方塊的聯集。

另請參閱

適用於