Re: CGImage to NSImage, or PDFPage?
Re: CGImage to NSImage, or PDFPage?
- Subject: Re: CGImage to NSImage, or PDFPage?
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 10 Aug 2010 16:02:25 -0600
On Aug 10, 2010, at 3:45 PM, Brian Postow wrote:
> Is there something obvious that I'm missing?
Yes. If you can require Leopard or later, then just create an NSBitmapImageRep using -initWithCGImage:, then create the NSImage with the size of the CGImage and add that NSBitmapImageRep to the NSImage. If not, then create a new image with the size of the CGImage, lock focus on the image, draw the CGImage using CGContextDrawImage(), and unlock focus.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden