2

I have written some code in a UIImage category that takes a UIImage (self) and then redraws it using CGContextRef. Is there any way to rewrite the UIImage (self) while using CGBitmapContext? Currently, I have it returning the image that was created through the CGContextRef, but is it possible to rewrite the image itself within that method?

RileyE
  • 10,874
  • 13
  • 63
  • 106

1 Answers1

5

From the UIImage documentation:

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.

It is therefore not possible to change the image data of an UIImage after is has been created.

Martin R
  • 529,903
  • 94
  • 1,240
  • 1,382