12
我发现,在IOS 的UIImage可以换到CIImage。而存在的UIImage属性CIImage。当我使用UIImage时,UIImage对象不是null,但UIImage.ciimage
为空,为什么?谁能告诉我,为什么UIImage.ciimage为空
原谅我愚蠢的问题,如果有人可以帮助我,非常感谢。
ADD
例如,代码像下面返回NULL:
UIImage *image = [UIImage imageNamed:@"test.jpg"];
CIImage *ciImage = image.CIImage
,但如果以这种方式CIImage不为空:
UIImage *image = [UIImage imageNamed:@"test.jpg"];
CIImage *myImage = [[CIImage alloc] initWithCGImage:image.CGImage options:nil];
@matt然后,如何将UIImage转换为CIImage? – brimstone 2016-03-23 18:04:00
@brimstone使用CIImage的'initWithImage:'初始化程序。 – matt 2016-03-23 18:10:13
我发现有时直接从CIImage直接到UIImage并不总是工作。我将CIImage转换为CGIImage,然后转换为UIImage,它工作得很好。 – Munib 2016-12-30 02:45:34