UIImage -> CGImageRef

眉间皱痕 提交于 2019-12-03 03:29:57

问题


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... :)


回答1:


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




回答2:


CGImageRef cgImage = [someImage CGImage];



回答3:


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

CGImage imageRef = imageObject.CGImage


来源:https://stackoverflow.com/questions/6067307/uiimage-cgimageref

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!