我正在使用Xcode 5和iOS7使用Photo app。问题是,当我应用CICrystallize过滤器并运行项目时,模拟器的屏幕变为空白。谁能帮助我? 该方法的实施是:
- (IBAction)cristalizar:(id)sender {
CIImage *imagen = [[CIImage alloc]initWithCGImage:self.imagenView.image.CGImage];
CIFilter *cristalizar = [CIFilter filterWithName:@"CICrystallize"];
[cristalizar setDefaults];
CIVector *vector = [CIVector vectorWithX:150 Y:150];
[cristalizar setValue:imagen forKey:kCIInputImageKey];
[cristalizar setValue:@20.00f forKey:kCIInputRadiusKey];
[cristalizar setValue:vector forKey:kCIInputCenterKey];
CIImage *resultado = [cristalizar valueForKey:kCIOutputImageKey];
CIContext *contexto = [CIContext contextWithOptions:nil];
CGImageRef cgImagen = [contexto createCGImage:resultado fromRect:[resultado extent]];
self.imagenView.image = [UIImage imageWithCGImage:cgImagen];
}