Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UIElement.RenderTransformOrigin Property

Gets or sets the center point of any possible render transform declared by RenderTransform, relative to the bounds of the element. This is a dependency property.

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

Public Property RenderTransformOrigin As Point
    <Point X="xOrigin" Y="yOrigin"/>
<object RenderTransformOrigin="xOrigin, yOrigin"/>

XAML Values


The horizontal origin factor. This is typically given as a value between 0 and 1. See Remarks.


The vertical origin factor. This is typically given as a value between 0 and 1. See Remarks.

Property Value

Type: System.Windows.Point
The value that declares the render transform. The default value is a Point with coordinates (0,0).

Identifier field


Metadata properties set to true


RenderTransformOrigin has a somewhat nonstandard use of the Point structure value, in that the Point does not represent an absolute location in a coordinate system. Instead, values between 0 and 1 are interpreted as a factor for the range of the current element in each x,y axis. For example, (0.5,0.5) will cause the render transform to be centered on the element, or (1,1) would place the render transform at the bottom right corner of the element. NaN is not an accepted value.

Values beyond 0 and 1 are also accepted, and will result in more unconventional transform effects. For instance, if you set RenderTransformOrigin to be (5,5), and then apply a RotateTransform, the rotation point will be well outside the bounds of the element itself. The transform will spin your element around in a big circle that originates beyond bottom right. The origin might be somewhere inside its parent element and could possibly be possibly out of frame or view. Negative point values are similar, these will go beyond the top left bounds.

Render transforms do not affect layout, and are typically used to animate or apply a temporary effect to an element.

The following example builds up elements in code, applies a RenderTransformOrigin, and then applies a RenderTransform.

		Public Sub New()
			Me.WindowTitle = "Rotate About Center Example"
			NameScope.SetNameScope(Me, New NameScope())
			Dim myStackPanel As New StackPanel()
			myStackPanel.Margin = New Thickness(50)

			Dim myButton As New Button()
			myButton.Name = "myRenderTransformButton"
			myButton.RenderTransformOrigin = New Point(0.5,0.5)
			myButton.HorizontalAlignment = HorizontalAlignment.Left
			myButton.Content = "Hello World"

			Dim myRotateTransform As New RotateTransform(0)
			myButton.RenderTransform = myRotateTransform


			' Creates an animation that accelerates through 40% of its duration and
			'      decelerates through the 60% of its duration.
			Dim myRotateAboutCenterAnimation As New DoubleAnimation()
			Storyboard.SetTargetProperty(myRotateAboutCenterAnimation,New PropertyPath(RotateTransform.AngleProperty))
			myRotateAboutCenterAnimation.From = 0.0
			myRotateAboutCenterAnimation.To = 360
			myRotateAboutCenterAnimation.Duration = New Duration(TimeSpan.FromMilliseconds(1000))

			' Create a Storyboard to contain the animations and
			' add the animations to the Storyboard.
			Dim myStoryboard As New Storyboard()

			' Create an EventTrigger and a BeginStoryboard action to
			' start the storyboard.
			Dim myEventTrigger As New EventTrigger()
			myEventTrigger.RoutedEvent = Button.ClickEvent
			myEventTrigger.SourceName = myButton.Name
			Dim myBeginStoryboard As New BeginStoryboard()
			myBeginStoryboard.Storyboard = myStoryboard

			Me.Content = myStackPanel
		End Sub

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

© 2017 Microsoft