CABasicAnimation 期间的运动模糊

发布于 2024-12-10 01:55:47 字数 574 浏览 1 评论 0原文

我有一个简单的动画,可以将图像从一个点移动到另一个点:

    CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"position"];
    anim.fromValue  = [NSValue valueWithCGPoint:CGPointMake(px2.x, px2.y)];
    anim.toValue    = [NSValue valueWithCGPoint:CGPointMake(P3x, P3y)];
    anim.duration   = 1.5f;
    anim.repeatCount =1;
    anim.removedOnCompletion = YES;
    anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
    [LA  addAnimation:anim forKey:@"positionTest"];

问题是图像在运动时变得模糊,运动不是很快。 有没有办法减少这种运动模糊?

I have this simple animation that moves an image from one point to another:

    CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"position"];
    anim.fromValue  = [NSValue valueWithCGPoint:CGPointMake(px2.x, px2.y)];
    anim.toValue    = [NSValue valueWithCGPoint:CGPointMake(P3x, P3y)];
    anim.duration   = 1.5f;
    anim.repeatCount =1;
    anim.removedOnCompletion = YES;
    anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
    [LA  addAnimation:anim forKey:@"positionTest"];

The problem is that the image becomes blurry while in motion, the motion is not very fast.
Is there a way to reduce this motion blur?

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

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

发布评论

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

评论(1

明月松间行 2024-12-17 01:55:47

如果你在动画过程中截图,它肯定是模糊的吗?模糊是像素化模糊还是更像软高斯模糊?

尝试设置view.layer.shouldRasterize = yes和layer.rasterizationScale = UIScreen.mainScreen.scale;

If you take a screenshot during the animation is it definitely blurred? Also is the blurring a pixellated blur or is it more like a soft gaussian blur?

Try setting view.layer.shouldRasterize = yes and layer.rasterizationScale = UIScreen.mainScreen.scale;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文