makeImage()
Creates and returns a CGImage from the pixel data in a bitmap graphics context.
Declaration
func makeImage() -> CGImage?Return Value
A CGImage object that contains a snapshot of the bitmap graphics context or NULL if the image is not created.
Discussion
The CGImage object returned by this function is created by a copy operation. Subsequent changes to the bitmap graphics context do not affect the contents of the returned image. In some cases the copy operation actually follows copy-on-write semantics, so that the actual physical copy of the bits occur only if the underlying data in the bitmap graphics context is modified. As a consequence, you may want to use the resulting image and release it before you perform additional drawing into the bitmap graphics context. In this way, you can avoid the actual physical copy of the data.