• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: convert GraphicsImportComponent to NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: convert GraphicsImportComponent to NSImage


  • Subject: Re: convert GraphicsImportComponent to NSImage
  • From: Michael Silva <email@hidden>
  • Date: Fri, 21 Apr 2006 22:04:24 -0400

Thanks. I had tried this method, but the image is messed up (wrong color space or something) after the CGImage conversion.


On Apr 21, 2006, at 7:49 PM, Jonathan Johnson wrote:

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.


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >convert GraphicsImportComponent to NSImage (From: Michael Silva <email@hidden>)
 >Re: convert GraphicsImportComponent to NSImage (From: "Jonathan Johnson" <email@hidden>)

  • Prev by Date: Re: convert GraphicsImportComponent to NSImage
  • Next by Date: Re: memory leak in readInBackgroundAndNotify
  • Previous by thread: Re: convert GraphicsImportComponent to NSImage
  • Next by thread: Accessing Cocoa instance variables from C functions
  • Index(es):
    • Date
    • Thread