CGImage from NSURL works but not from UIImage

后端 未结 2 629
Happy的楠姐
Happy的楠姐 2021-01-26 10:48

I have some issues applying filters to an image. The following code works perfect when using CIImage:imageWithContentsOfURL:

NSInteger filterIndex = [(UITapGestu         


        
2条回答
  •  情话喂你
    2021-01-26 10:53

    Juraj Antas' answer in this question How to Convert UIImage to CIImage and vice versa fixed my issue:

    UIImage *u = [UIImage imageNamed:@"image.jpg"];
    CIImage *image = [[CIImage alloc] initWithCGImage: u.CGImage];
    

提交回复
热议问题