I've got some code to resize a UIImage (in a category to UIImage), that first generates an Image Context:
CGImageRef oldImage = [self CGImage];
CGSize oldSize = [self size];
CGContextRef context = CGBitmapContextCreate(NULL, //Data
newSize.width, //Width
newSize.height, //Height
CGImageGetBitsPerComponent(oldImage), // Bits per Component
4 * newSize.width, //Bytes per Row
CGImageGetColorSpace(oldImage), //Color Space
CGImageGetBitmapInfo(oldImage)); //Info
On the device, this code works well, but on the simulator it fails with the following error:
<Error>: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 24 bits/pixel; 3-component colorspace; kCGImageAlphaNone; 428 bytes/row.
Does anyone have an explanation for this? If I remember correctly, it worked fine prior to 2.2 Thanks!