CGImage of UIImage return NULL

后端 未结 5 688
情深已故
情深已故 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:39

    The CGImage property will return nil if the UIImage was created from another image such as an IOSurface or CIImage. To get around this in this particular case I can create a CGImage from an IOSurface using the c function then convert that to a UIImage.

    UICreateCGImageFromIOSurface(IOSurfaceRef surface);
    

提交回复
热议问题