CGImage of UIImage return NULL

后端 未结 5 687
情深已故
情深已故 2021-01-12 05:16

I created a function for splitting an image into multiple images, but when I take take the CGImage of the UIImage, the CGImage returns NULL

NSArray* splitIma         


        
5条回答
  •  悲哀的现实
    2021-01-12 05:44

    I have created UIImage from CGImage.

    CIImage *ciImage = image.CIImage;
    CIContext *context = [CIContext contextWithOptions:nil];
    CGImageRef ref = [context createCGImage:ciImage fromRect:ciImage.extent];
    UIImage *newImage = [UIImage imageWithCGImage:ref];
    

    And now newImage.CGImage is not nil

提交回复
热议问题