为什么RenderTransformOrigin中心是0.5,0.5? [英] Why center of RenderTransformOrigin is 0.5,0.5?

查看:748
本文介绍了为什么RenderTransformOrigin中心是0.5,0.5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我看到在使用RenderTransformOrigin样本代码,他们将有0.5,0.5为中心,而不是0,0。我都试过,我看不出有什么差别。有没有为什么作为中心,而不是0,0 0.5,0.5使用的理由?

When I see samples codes where RenderTransformOrigin is used, they would have 0.5,0.5 as the center instead of 0,0. I tried both and I don't see any differences. Is there a reason why 0.5,0.5 use used as center instead of 0,0?

推荐答案

据的MSDN RenderTransformOrigin 的值是

0和1之间[和]值
解释为当前的范围
A因子元件在每个x,y
轴。例如,(0.5,0.5)将
导致渲染变换为
中心的元件上,或(1,1)
将使渲染变换为
中的底部的
元素的右上角。

values between 0 and 1 [and] 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.

在换句话说,0.5,0.5场所中的元件的中心变换原点和0,0其放置在左上角。如果应用旋转变换,前者的结果是一个有关元件的中心旋转,并且在后一种情况下,旋转是绕其左上角。

In other words, 0.5,0.5 places the transform origin in the center of the element, and 0,0 places it at the top left corner. If you apply a rotation transform, the result of the former is a rotation about the element's center, and in the the latter case, the rotation is about its top left corner.

这篇关于为什么RenderTransformOrigin中心是0.5,0.5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆