我在 UIImage 类别中编写了一些代码,该类别采用 UIImage(自身),然后使用 CGContextRef 重新绘制它。使用 CGBitmapContext 时有什么方法可以重写 UIImage (self) 吗?目前,我让它返回通过 CGContextRef 创建的图像,但是是否可以在该方法中重写图像本身?
最佳答案
来自 UIImage
文档:
Image objects are immutable, so you cannot change their properties after creation. ... Because image objects are immutable, they also do not provide direct access to their underlying image data.
因此,UIImage
创建后无法更改其图像数据。
关于objective-c - iOS:更改自身的内容(UIImage),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12062857/