VisualTreeHelper.GetContentBounds Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기