CGBitmapContextCreate
CGBitmapContextCreate is a Core Graphics function that creates a bitmap-based graphics context backed by a memory buffer. It is part of Quartz 2D and is commonly used for offscreen drawing, image generation, and pixel-level rendering.
The function signature is CGContextRef CGBitmapContextCreate(void *data, size_t width, size_t height, size_t bitsPerComponent, size_t bytesPerRow, CGColorSpaceRef
The created context can be used like any other Core Graphics drawing destination. After drawing, you can
In Swift, the same functionality is exposed through higher-level CGContext initializers that bridge to CGBitmapContextCreate, providing