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 视觉对象。

返回

的边界框 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自身。

另请参阅

适用于