Re: NSCacheImageRep woes
Re: NSCacheImageRep woes
- Subject: Re: NSCacheImageRep woes
- From: Andrew Platzer <email@hidden>
- Date: Wed, 14 Jan 2004 16:30:33 -0800
On Jan 14, 2004, at 12:18 PM, Nicholas Francis wrote:
Hi guys - I have a small problem getting to my image data.
I load a bitmap image (tiff) using the +[NSImage imageNamed:] method,
and want to access the pixel data....
However, when the user runs in 16bpp on the desktop, when looking
through the bitmap's representations, I only get one NSCachedImageRep.
FWIW, here is the its -description:
NSCachedImageRep 0x1980df0 Size={12, 12}
ColorSpace=NSCalibratedRGBColorSpace BPS=4 Pixels=12x12 Alpha=NO
What gives? I would expect to also have the original NSBitmapImageRep
that the cache is generated from. I tried looking through NSImage
documentation, but can find no function I have to call to make it keep
the data around.
[image setCacheMode:NSImageCacheNever];
Do this before you draw the image. By default, the system caches images
if it can save space. If you are running in thousands of colours, it
will render the image to a cached rep since it will take 1/2 as much
space.
Andrew
_______________________________
Andrew Platzer
Application Frameworks
Apple Computer, Inc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.