• 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: How to draw a CGImage object to a NSView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to draw a CGImage object to a NSView?


  • Subject: Re: How to draw a CGImage object to a NSView?
  • From: "Ken Ferry" <email@hidden>
  • Date: Wed, 20 Feb 2008 15:44:26 -0800

On Wed, Feb 20, 2008 at 3:26 PM, Jim Correia <email@hidden> wrote:
> On Feb 20, 2008, at 5:29 PM, Ken Ferry wrote:
>
>  >> I think it will cost too much performance to convert the CGImage
>  >> objects to other formats, e.g. NSImage, CIImage.
>  >
>  > It isn't very expensive to make an NSImage from a CGImage.  If you
>  > create an NSBitmapImageRep with -initWithCGImage:, the
>  > NSBitmapImageRep will just reference the CGImage and draw it when
>  > necessary.  There is no conversion of the data.
>
>  It is worth pointing out that an NSBitmapImageRep created in this way
>  is dependent on the CGImage - the CGImage's lifetime must be at least
>  that of the dependent bitmap image rep.
>
>  http://lists.apple.com/archives/cocoa-dev/2008/Jan/msg01474.html
>
>  http://lists.apple.com/archives/cocoa-dev/2008/Jan/msg01481.html

That's reversed.  The limitation is that if you take a CGImage from an
arbitrary NSBitmapImageRep with -CGImage, the CGImage may undetectably
go invalid when the bitmap is destroyed.

Hopefully this issue will be lifted in a future release.

-Ken
_______________________________________________

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

  • Follow-Ups:
    • Re: How to draw a CGImage object to a NSView?
      • From: Jim Correia <email@hidden>
References: 
 >How to draw a CGImage object to a NSView? (From: Leopard x86 <email@hidden>)
 >Re: How to draw a CGImage object to a NSView? (From: "Ken Ferry" <email@hidden>)
 >Re: How to draw a CGImage object to a NSView? (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: NSStringFromClass versus className ?
  • Next by Date: Binding an entity object (not an entity attribute) to a Table View Column
  • Previous by thread: Re: How to draw a CGImage object to a NSView?
  • Next by thread: Re: How to draw a CGImage object to a NSView?
  • Index(es):
    • Date
    • Thread