CABasicAnimation 期间的运动模糊
我有一个简单的动画,可以将图像从一个点移动到另一个点:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你在动画过程中截图,它肯定是模糊的吗?模糊是像素化模糊还是更像软高斯模糊?
尝试设置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;