• 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: Forcing NSImage to cache images at certain sizes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing NSImage to cache images at certain sizes


  • Subject: Re: Forcing NSImage to cache images at certain sizes
  • From: Ken Ferry <email@hidden>
  • Date: Fri, 21 May 2010 19:10:29 -0700

Hi BJ,

On Fri, May 21, 2010 at 2:44 PM, B.J. Buchalter <email@hidden> wrote:

> I read the NSImage and Cocoa drawing guide docs, which tends to indicate
> that calling drawInRect:fromRect:operation:fraction: on an NSImage will
> cause it to create a cached image rep that matches the scaled image so that
> the next time it is drawn it does not need to be scaled again.
>

The docs haven't fully integrated new info from 10.6, when NSImage changed a
bunch.  Take a look at the AppKit release
notes<http://developer.apple.com/mac/library/releasenotes/cocoa/appkit.html>
.


>
> That is not what I am seeing here, and the scaling is definitely taking a
> nontrivial amount of time when redrawing my views. I have played around with
> setting the caching and scaling on the NSImage, but it doesn't appear to be
> having any impact (the internal image rep for the image never changes).
>

Could you attach a test app please?  There's more than one thing that could
be the issue.


>
> What is the proper way to ensure that the NSImage is cached to match the
> required drawing size? Do I need to build my own cache?
>
> Thanks!
>
> B.J. Buchalter
> Metric Halo
> http://www.mhlabs.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
>
_______________________________________________

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: Forcing NSImage to cache images at certain sizes
      • From: "B.J. Buchalter" <email@hidden>
References: 
 >Forcing NSImage to cache images at certain sizes (From: "B.J. Buchalter" <email@hidden>)

  • Prev by Date: Re: Compatibility of Data iPhone / Mac
  • Next by Date: Re: Getting TextEdit to Recognise UTF-8 Output [solved]
  • Previous by thread: Forcing NSImage to cache images at certain sizes
  • Next by thread: Re: Forcing NSImage to cache images at certain sizes
  • Index(es):
    • Date
    • Thread