我已經使用核心圖像框架在我的項目中添加圖像過濾器。我添加的前五個過濾器工作正常。但是當我實現其他過濾器。圖像熄滅。工作是: 1)CIHueAdjust 2)CIGammaAdjust 3)CIExposureAdjust 4)CIColorMonochrome 5)CISepiaTone 沒有工作對我來說,其他過濾器是CIGloom,CILineOverlay和others.Here是我code.Plz幫助我是我我錯了.....使用核心圖像過濾器的圖像
CIImage *inputImage = [[CIImage alloc] initWithImage:[UIImage imageNamed:@"leaves2.png"]];
CIFilter *Gloom = [CIFilter filterWithName:@"CIGloom"];
[Gloom setDefaults];
[Gloom setValue: inputImage forKey:@"inputImage"];
[Gloom setValue:[NSNumber numberWithFloat: 10.00]
forKey:@"inputRadius"];[Gloom setValue:[NSNumber numberWithFloat: 0.8f]
forKey:@"inputIntensity"];
CIImage *outputImage = [Gloom valueForKey:@"outputImage"];
// define context
CIContext *context = [CIContext contextWithOptions:nil];
// set image to UIImageView
imageView.image = [UIImage imageWithCGImage:
[context createCGImage:outputImage
fromRect:outputImage.extent]];
當我點擊button.The圖像去F。
是否'Gloom'獲得分配一個有效的指針在第二行? – Caleb 2011-12-22 07:48:05
是的。它得到。它適用於其他filters.But對於某些過濾器,它不 – 2011-12-22 10:55:39
當圖像返回。它爲空。 – 2011-12-22 11:11:22