Creates and returns a CGImage from the pixel data in a bitmap graphics context.
- iOS 2.0+
- macOS 10.4+
- tvOS 9.0+
- watchOS 2.0+
- Mac Catalyst 13.0+Beta
- Core Graphics
A bitmap graphics context.
A CGImage object that contains a snapshot of the bitmap graphics context or
NULL if the image is not created.
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.