Re: Bulletproof way to create a new CGBitmapContext from an existing image?

2009-11-06 Thread Demitri Muna
Hi Steve and David, Thank you both for your comments; they were very helpful. I had thought that I had to match the context to the image I was going to use, but that's clearly wrong. I had missed that link to the supported pixel formats - that's very informative. Steve's comment also

Re: Bulletproof way to create a new CGBitmapContext from an existing image?

2009-11-03 Thread David Duncan
On Nov 1, 2009, at 8:45 AM, thatsanicehatyouh...@mac.com wrote: I'm trying to write code to avoid messages such as this: Error: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 16 bits/pixel; 1-component colorspace; kCGImageAlphaPremultipliedFirst; 352

Re: Bulletproof way to create a new CGBitmapContext from an existing image?

2009-11-03 Thread Steve Christensen
Why not alway create a CGBitmapContext of the desired size and in a supported pixel format (see http://developer.apple.com/mac/library/qa/qa2001/qa1037.html ), then call CGContextDrawImage to draw the CGImage into the context? Then you're always controlling the parameters. CGRect bounds =

Bulletproof way to create a new CGBitmapContext from an existing image?

2009-11-02 Thread thatsanicehatyouhave
Hi, I have some code where I'm downloading images from the internet. They're probably all going to be jpegs, but I'm not making that assumption in my code. I have no control over the images. I'm creating a CGBitmapContext to manipulate them. Further, I'm scaling the image (could be up or