Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Converting to/from NSImage, NSBitmapImageRep, CGContextRef, CGImageRef
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting to/from NSImage, NSBitmapImageRep, CGContextRef, CGImageRef



Hi!

I am new to this list (and Quartz) and I hope my question in on-topic.

Are there any convenience methods to convert between Cocoa and Quartz
images?  I've looked and have found that:
1) they don't seem to be 'toll free bridged'
2) WebKit provides NSImage to CGImageRef conversion
(WebConvertNSImageToCGImageRef())

In my specific case, I'm looking to convert an NSBitmapImageRep to a
'bitmap graphics context', and vice versa, though I'm curious about
conversions in general.  (I know I could use CGBitmapContextCreate() and
-bitmapData, but I'm hoping for a one-liner :) )

Thanks!

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.