On 11 Aug 2008, at 17:52, Ken Ferry wrote:

A combination of -setDataRetained: on image loading and -recache on zooming did the trick, although I did need to kludge in a size check before calling -recache as rasterising an entire PDF above ~10,000x10,000 quickly gets painful performance- and memory-wise.

For drawing that would lead to a very large raster cache, NSImage prefers to draw directly from the source rather than make a cache.

That would make lots of sense. Unfortunately it isn't doing it for me, and if the image is big enough a memory error occurs.


However, it sounds like this isn't doing it for you. Could you file a bug with a demonstration app?

Done. Filed as bug ID# 6143188 (NSImage caching and vector images: out- of-memory error).


Perhaps you could try just turning caching off, or turning it off when the scale factor is high?

Just tried this as-per your suggestion, but - setCacheMode:NSImageCacheNever doesn't appear to have any effect as the NSImage continues to create and use a raster cache. Filed as bug ID# 6143199 (NSImage caching and vector images: -setCacheMode: ignored).

I also ran into a third problem while writing demos for the first two: NSImages created via +imageNamed: constructor appear to ignore - setDataRetained:YES. Filed as bug ID# 6143194 (NSImage caching and vector images: -setDataRetained: ignored).


Also, sorry, there's nothing built-in that caches partial images or holds caches for multiple destination sizes.


Okay, I can probably kludge something if I have to, although when zoomed in it would be much better if NSImage just drew the visible portion of the PDF directly as you say it should.


In the meantime, given the problems I'm having with NSImage's caching behaviour, any suggestions on how else I could draw PDF/EPS files into nested, Core Animation-enabled NSViews?

Many thanks,

Hamish

--

Hamish Sanderson
Production Workflow Developer
Sun Branding Solutions Ltd
Tel: +44(0)1274 200 700
www.s-brandingsolutions.com




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to