VisualTreeHelper::GetTransform Method (Visual^)
.NET Framework (current version)
Namespace:
System.Windows.Media
Assembly: PresentationCore (in PresentationCore.dll)
Return to top
Assembly: PresentationCore (in PresentationCore.dll)
Parameters
- reference
-
Type:
System.Windows.Media::Visual^
The Visual whose transform value is returned.
Return Value
Type: System.Windows.Media::Transform^The transform value of the Visual, or null if reference does not have a transform defined.
Alternatively, you can use the TransformToAncestor method to return a transform value for the ancestor of a Visual. This method always returns a valid transform. The following code example shows how to use TransformToAncestor method.
The following code example shows how to use the GetTransform method to retrieve the transform for the specified visual object.
Your code should test for null before using the returned value. To return the offset of the returned transform, use the Transform method. The offset value is relative to the parent of the Visual.
.NET Framework
Available since 3.0
Available since 3.0
Show: