Re: convert GraphicsImportComponent to NSImage
Re: convert GraphicsImportComponent to NSImage
- Subject: Re: convert GraphicsImportComponent to NSImage
- From: "Jonathan Johnson" <email@hidden>
- Date: Fri, 21 Apr 2006 18:49:02 -0500
On 4/21/06, Michael Silva <email@hidden> wrote:
> Is there any reference to get an image stored as
> GraphicsImportComponent into a Cocoa NSImage object? Does anyone
> have any suggestions?
As of QuickTime 6.5, you can use GraphicsImportCreateCGImage to get a
CGImageRef. Then, the only way I know to get this into an NSImage
would be to create a new NSBitmapImageRep, lock focus, draw the image
using CoreGraphics, and unlock focus.
A couple of conversions, but it's better than nothing, and doesn't
involve the disk.
Depending on your requirements, you might also consider using ImageIO
on 10.4 to skip the QT->CGImageRef step, and start with a CGImageRef.
HTH,
Jon
--
Jonathan Johnson
REAL Software, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden