Re: I want ALL my tiff pixels
Re: I want ALL my tiff pixels
- Subject: Re: I want ALL my tiff pixels
- From: Brock Brandenberg <email@hidden>
- Date: Wed, 12 Mar 2003 11:35:02 -0600
Hi Bob.
>
What I want: I want all my 1200 x1200 pixels, and to know that the
>
resolution field says it's 600 dpi so that I can scale it
>
myself to what ever magnification I want and so that it will print
>
nicely.
A very "under-emphasized" key to using NSImage is understanding when the
NSImage generates and uses a cached version of an image instead of the
original data itself. It's true that you can load an image and immediately
check the NSImage parameters and find that you have the data that you think
you have. However, at the first use of the data for drawing, the NSImage can
cache a bitmapped version and discard the original image data, depending
upon the type of data (PDFRep, BitmapRep, etc.). If the data is not
discarded, the cached image rep may still be used, causing confusion like
you are seeing.
Look at the setDataRetained: and setCacheMode: methods to get a feel for the
way NSImage handles its data and how it caches images to speed drawing. Then
look at the NSBitmapImageRep and consider creating an NSBitmapImageRep from
your data, then adding the representation to an empty NSImage. This
technique is used often to more accurately control the representations that
an NSImage maintains, rather than relying on the NSImage to create the reps
for you.
This should help highlight your problem area. I had difficulty with PDFs
until I began to understand how NSImage created and maintained image
representations, and how it used the cached image rep in particular.
Brock Brandenberg
----- industrial design @ www.bergdesign.com ------
_______________________________________________
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.