Re: NSImage with multiple representation sizes
Re: NSImage with multiple representation sizes
- Subject: Re: NSImage with multiple representation sizes
- From: Ken Ferry <email@hidden>
- Date: Tue, 8 Sep 2009 13:20:55 -0700
On Tue, Sep 8, 2009 at 11:42 AM, Benjamin Rister <email@hidden> wrote:
> So to be clear: if I create a TIFF image, with tiffutil -cat, that has
>> 9x9px@72dpi, 16x16px@72dpi, 32x32px@72dpi:
>> - This is an entirely supported configuration, despite what man tiffutil
>> says and the warning it generates.
>>
>
> No, these reps would not have the same -size. If you set the DPI metadata
> for the reps to 72, 128, and 256 respectively, then each rep would have
> -size 9x9.
>
> This is what I meant above. It's fine to have different pixel sizes, but
> it's best to set the metadata so that the -size is consistent.
>
>
> Okay, take 2 then. If I do the same thing, with 9x9px@72dpi,
> 16x16px@128dpi, and 32x32px@256dpi (so the tiffutil warning isn't
> applicable anymore), will NSImage correctly use the more detailed image when
> drawing into a 16x16pt space? As I mentioned, Cocoa Drawing Guide > Images
> > How an Image Representation Is Chosen gives rules to be applied in the
> order of color space, dpi, bit depth. All have the same color space, the
> 9x9px@72dpi matches dpi (when at 1.0 scale factor) and the others don't,
> so according to the docs it's the one that would be chosen, with poor
> results.
>
On 10.6 and later, yes, you can count on it choosing 16x16 pixel
representation. We're not looking at resolution anymore, only number of
pixels in rep vs number of pixels to be filled.
I'm pretty sure it would on previous OSes too, but not 100% positive.
-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