【问题标题】:UIImageView 3D distortionUIImageView 3D失真
【发布时间】:2012-07-12 17:03:52
【问题描述】:

我一直在寻找 stackoverflow 和互联网很长一段时间,但似乎找不到任何可用的东西。

我想实现这一点:

我可以改变四个角的原点很重要。 像这样的:

imageView.layer.somethingMagic.imageRightTop = (CGPoint){ 230, 30 };
imageView.layer.somethingMagic.imageRightBottom = (CGPoint){ 300, 150 };

它会生成一个变形的“3D”图像。

我不需要实际工作的代码,只需要一些在哪里/要查找什么的指针。

【问题讨论】:

标签: iphone objective-c uiview uiimageview distortion


【解决方案1】:

您需要使用CGAffineTransformConcat / CGAffineTransformDistort。这里有一个教程展示了如何做到这一点:

http://b2cloud.com.au/how-to-guides/ios-distort-transform

#define CGAffineTransformDistort(t, x, y) (CGAffineTransformConcat(t, CGAffineTransformMake(1, y, x, 1, 0, 0)))
#define CGAffineTransformMakeDistort(x, y) (CGAffineTransformDistort(CGAffineTransformIdentity, x, y))

显然不要在UIViewAnimation 中使用它,如上页示例所示。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-06-23
  • 2017-12-22
相关资源
最近更新 更多