the pointer data if pointing to some image generated by an iphone application. Does anybody now if using CGBitmapContextCreate make a copy of this data or does it use the image "in place"?
Ideally, I'd like to reuse the information in data* and not create any additional copy of this image.
void* data = <my data>;
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef imageContext = CGBitmapContextCreate(data, w, h, 8, w*8, colorSpace, kCGBitmapByteOrder32Big|kCGImageAlphaPremultipliedLast);
CGImageRef imageRef = CGBitmapContextCreateImage(imageContext);
UIImage* image =[[UIImage alloc] initWithCGImage:imageRef];
More generally, this method of creating image seems rather convoluted to me. Does anybody knows what's going on here? Is there any easier way to create UIImage?
Thanks