使用代码过滤器:
imgAnimation=[[UIImageView alloc]initWithFrame:frame];
imgAnimation.animationImages=_arrimg;
//animationImages=animationImages;
imgAnimation.contentMode=UIViewContentModeScaleAspectFit;
imgAnimation.animationDuration = 2.0f;
imgAnimation.animationRepeatCount = 0;
[imgAnimation startAnimating];
[self.view addSubview:imgAnimation];
动画实现的很好,还要实现 sepia, grey scale 效果。不知道怎么实现?
在使用 Core Image 时,需要注意以下几点:
首先,需要在您的 Xcode 项目中导入 Core Image 框架。
其次,您需要在使用 Core Image 的代码中捕获 CIContext 创建失败的情况,因为在某些情况下,CIContext 可能无法创建。
在使用 CIFilter 时,需要注意滤镜名称的拼写是否正确。滤镜名称是区分大小写的,并且在使用滤镜时需要使用正确的名称。
最后,需要注意的是,Core Image 处理图像时会消耗大量 CPU 资源。如果您的应用程序需要高性能,则应该避免在主线程上使用 Core Image。最好的做法是将 Core Image 处理移动到后台线程。