UIImage -> CGImageRef

前端 未结 3 1248
有刺的猬
有刺的猬 2021-01-31 07:55

I\'m building an Iphone app that needs to convert a UIImage to a CGImageRef. I have no idea how to do this and would love some help. I have no background in working with images.

相关标签:
3条回答
  • 2021-01-31 08:23
    CGImageRef cgImage = [someImage CGImage];
    
    0 讨论(0)
  • 2021-01-31 08:24

    It is as simple as image.CGImage where image is a UIImage object.

    0 讨论(0)
  • 2021-01-31 08:40

    write folowing to get CGImage from UIImage: Suppose u have an UIImage object ex imageObject then,

    CGImage imageRef = imageObject.CGImage
    
    0 讨论(0)
提交回复
热议问题