What does a correct call to CGImageCreate look like if the data provider for it uses an array created by the app?
问题 I'm trying to create a bitmap in memory as part of a pattern function that a drawLayer:inContext: method (this method is part of the CALayer delegate protocol) will call. The pattern function looks similar to this: static const size_t kComponentsPerPixel = 4; static const size_t kBitsPerComponent = sizeof(unsigned char) * 8; NSInteger layerHeight = 160; NSInteger layerWidth = 160; CGContextSaveGState(context); CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB(); size_t bufferLength =