編集

次の方法で共有


VisualTreeHelper.GetContentBounds Method

Definition

Returns the cached bounding box rectangle for the Visual.

Overloads

GetContentBounds(Visual3D)

Returns the cached bounding box rectangle for the specified Visual3D.

GetContentBounds(Visual)

Returns the cached bounding box rectangle for the specified Visual.

GetContentBounds(Visual3D)

Returns the cached bounding box rectangle for the specified 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

Parameters

reference
Visual3D

The 3D visual whose bounding box value is computed.

Returns

The bounding box 3D rectangle for the Visual3D.

Remarks

Use the GetDescendantBounds method to return the union of all the content bounding boxes for all the descendants of a 3D visual object, which includes the Visual3D itself.

See also

Applies to

GetContentBounds(Visual)

Returns the cached bounding box rectangle for the specified 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

Parameters

reference
Visual

The Visual whose bounding box value is computed.

Returns

The bounding box rectangle for the Visual.

Examples

The following example shows how to retrieve the bounding rectangle of a Visual object.

// 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)

Remarks

Call the GetDescendantBounds method to return the union of all the content bounding boxes for all the descendants of a visual object, which includes the Visual itself.

See also

Applies to