在 UIViewController 在 UIImageView 中显示图像。我想用一些特殊效果来显示它。使用核心 image.framework
UIImageView *myImage = [[UIImageView alloc]
initWithImage:[UIImage imageNamed:@"piano.png"]];
myImage.frame = CGRectMake(10, 50, 300, 360);
CIContext *context = [CIContext contextWithOptions:nil];
CIFilter *filter= [CIFilter filterWithName:@"CIVignette"];
CIImage *inputImage = [[CIImage alloc] initWithImage:[UIImage imageNamed:@"piano.png"]];
[filter setValue:inputImage forKey:@"inputImage"];
[filter setValue:[NSNumber numberWithFloat:18] forKey:@"inputIntensity"];
[filter setValue:[NSNumber numberWithFloat:0] forKey:@"inputRadius"];
[baseView addSubview:inputImage];
但看起来我错过了什么或做错了什么。