Re: CGImage to NSImage, or PDFPage?
Re: CGImage to NSImage, or PDFPage?
- Subject: Re: CGImage to NSImage, or PDFPage?
- From: John Calhoun <email@hidden>
- Date: Tue, 10 Aug 2010 15:05:10 -0700
On Aug 10, 2010, at 2:45 PM, Brian Postow wrote:
> I have a CGImageRef, and I need to put it into a PDFPage. At the moment, the only way I see to do that is to turn it into an NSImage first.
That will work, but it is also possible to subclass PDFPage and override the -[drawWithBox:] method in your subclass. Your method would get the current context as a CGContext and draw the CGImageRef directly.
Make sure to return the correct size in -[PDFPage boundsForBox:] as well.
John Calhoun—_______________________________________________
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