Turning an NSImage* into a CGImageRef?

Posted by Brian Postow on Stack Overflow See other posts from Stack Overflow or by Brian Postow
Published on 2010-03-30T19:27:19Z Indexed on 2010/03/30 23:13 UTC
Read the original article Hit count: 532

Is there an easy way to do this that works in 10.5?

In 10.6 I can use nsImage CGImageForProposedRect: NULL context: NULL hints: NULL

If I'm not using 1b black and white images (Like Group 4 TIFF), I can use bitmaps, but cgbitmaps seem to not like that setup... Is there a general way of doing this?

I need to do this because I have an IKImageView that seems to only want to add CGImages, but all I've got are NSImages. Currently, I'm using a private setImage:(NSImage*) method that I'd REALLY REALLY rather not be using...

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about objective-c