CABasicAnimation期间的运动模糊

时间:2011-10-16 19:01:11

标签: iphone objective-c core-animation core-graphics

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

    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"];

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

1 个答案:

答案 0 :(得分:0)

如果你在动画期间拍摄截图,它肯定会模糊吗?模糊像素化模糊还是更像软高斯模糊?

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