If we already have a Bitmap Graphics Context, and we converted this context to a CGImage. Now we want to add a single dot to the CGImage. Can we alter the CGImage directly, instead draw a single dot to the graphics context and covert the whole context once again to a CGImage?
The idea is that CGImage is also a structure, so if we can alter some data in the structure, that should somehow be possible?
CGImages are immutable. They cannot be changed after they are created.
CGBitmapContextCreateImagedoesn’t “convert” a context to an image — it effectively takes a snapshot of the current state of the context.You can draw more things in the original context. (The first CGImage will not be affected.) Then call
CGBitmapContextCreateImageagain, to get a new image with the new drawing in it.