在不改变角度的情况下以圆周运动变换 UIImage +可可

发布于 2024-12-21 07:51:01 字数 136 浏览 3 评论 0原文

我想以圆周运动变换/旋转 UIImage 而不改变图像的角度。下图解释了该要求。 在此处输入图像描述 如何使用 UIView 变换属性来完成此操作。提前致谢。

I want to transform/rotate an UIImage in circular motion without changing the angle of the image. Following diagram explains the requirement.
enter image description here
How this can be done using UIView transform property. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谜兔 2024-12-28 07:51:01

在我看来,您只需要使用 UIView 框架属性。但是,由于您在源和目标之间采用非线性路径,因此您可能必须涉足 CoreAnimation。

查看 CAKeyFrameAnimation 通过任意关键路径对属性进行动画处理。

祝你好运!

Sounds to me like you only need to use the UIView frame property. However, because you are taking a non-linear path between your source and destination you will likely have to dabble with CoreAnimation.

Check out CAKeyFrameAnimation to animate a property through an arbitrary key path.

Good Luck!

撩起发的微风 2024-12-28 07:51:01

我的书提供了沿路径对图像进行动画处理的示例代码:

http://www.apeth。 com/iOSBook/ch17.html#FIGnancyBell

CGMutablePathRef path = CGPathCreateMutable();
// ... define the path using CGPath... functions ...
CAKeyframeAnimation* anim1 = [CAKeyframeAnimation animationWithKeyPath:@"position"];
anim1.path = path;

My book provides sample code for animating an image along a path:

http://www.apeth.com/iOSBook/ch17.html#FIGnancyBell

CGMutablePathRef path = CGPathCreateMutable();
// ... define the path using CGPath... functions ...
CAKeyframeAnimation* anim1 = [CAKeyframeAnimation animationWithKeyPath:@"position"];
anim1.path = path;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文