OC

Knowledge OS
主帖 5 条回复

[help]IOS CoreGraphics下的CGAffineTransForm 的一个问题

ipoolo ipoolo · 2014年08月06日 · 阅读 12 · 无人欣赏。

CGAffineTransformIsIdentity

Checks whether an affine transform is the identity transform.

不是很懂这个CGAffineTransformIsIdentity 是什么意思

https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGAffineTransform/Reference/reference.html#//apple_ref/c/func/CGAffineTransformIsIdentity

回复

5 条
#2
ruandao
2014年08月06日

应该就是 未做未变换时的默认值

#3
sycx
2014年08月06日

CGAffineTransformIsIdentity()是用来判断一个transform是不是等于CGAffineTransformIdentity

至于什么是CGAffineTransformIdentity,你得稍微了解下Matrix,也就是矩阵。

你可以这么理解, Identity相当于基本运算里的数字 1

对于一个任意一个数字x, 会有等式 x * 1 = x

对于矩阵m来说, 会有等式 m * Identity = m

相关资料:

#4
djchen
2014年08月06日

如果你学习过opengl应该会了解,任何矩阵与identity矩阵相乘得到的结果仍然为原矩阵
在core graphics当中的含义也一样,transform的根本实际上就是矩阵的计算,identity表示没有应用过任何的变换(包括rotation 和translation).

登录 或者 注册