語言

VisualTreeHelper.GetContentBounds 方法

定義

回傳 的快取包圍框矩形 Visual。

多載

名稱 Description
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視覺化物件。

傳回

包圍盒 3D 矩形。Visual3D

備註

使用該 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 邊界盒值。

傳回

為 的包圍盒矩形 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 自身。

另請參閱

適用於