gpt4 book ai didi

objective-c - iOS 帧速率 - UIImage 始终为 30fps?

转载 作者:行者123 更新时间:2023-11-29 04:23:02 24 4
gpt4 key购买 nike

我想用一组图像创建逐帧动画。

可以设置animationDuration,标准值为1。

当我使用 startAnimating 启动动画时,我能否确定每个 iOS 设备上的帧率始终为 30fps?

所以我需要 15 个图像来制作 1 秒的动画 - 当我有超过或少于 15 个图像必须在一秒内制作动画时,我可以使用特殊的计算吗?

例如60/15*(计算数组中图像的数量)

最佳答案

我认为您不能指望 UIImageView animationImages 随时随地为您提供 30FPS。

事实上,这适用于非常简单且“机会主义”的动画。如果你用谷歌搜索它,你会发现reports该方法占用设备(在特定条件下)。另一方面,如果您的图像很小,那么它很可能可以工作,但您无法得到保证(也无法强制执行您所需的 FPS)。

So i need exactly 15 images for a 1 second animation - is there a special calculation i can use when i have more or less than 15 images that have to be animated in exactly one second?

如果我理解你的问题,那么你可以尝试:

duration = number_of_images / FPS; // e.g., 60 images / 30 FPS = 2 seconds

当然,如果设备能够以 30 FPS 正确显示 60 张图像,那就另当别论了。

关于objective-c - iOS 帧速率 - UIImage 始终为 30fps?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12724169/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com