• 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
NSImage with multiple representation sizes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage with multiple representation sizes


  • Subject: NSImage with multiple representation sizes
  • From: Benjamin Rister <email@hidden>
  • Date: Tue, 25 Aug 2009 09:44:24 -0400

The core question:
Is it still the best practice to have conceptually same images of different sizes in different files, e.g. Foo9x9.tiff, Foo32x32.tiff? icns isn't an option because they aren't all the standard icns sizes, and several places in the docs seem to discourage lumping them together (e.g. with tiffutil) anyway.



The details:

We have several images that are displayed at different sizes at various places in an application. Our artist has generated several bitmaps for these different scales. Modeling on the concept of an .icns file, my inclination would be to try and lump them all together in one multi-representation file and let NSImage figure out what the best representation is to draw from at any given point. This not only is convenient for the various usages around the app, but also for resolution independence (...maybe...see below).

However, man tiffutil says:
-cat allows combining multiple TIFF files into one. ... If the real sizes (pixel size
divided by dpi) of the images being combined are not the same, a warning
will be generated. This makes sure that NSImage can successfully choose
the right size image out of the generated TIFF file.

And Cocoa Drawing Guide: Images, "How an Image Representation Is Chosen" gives rules about color space, dpi, and bit depth, but there's no rule about choosing representations based on size. (But there's icns, right? How is that supposed to work, then?)


I'm also concerned for resolution independence that the system might not choose the 32x32px rep to fill a 16x16pt space at a 2x scale factor, because everything I've seen in the resolution independence docs only talks about representations with different dpi. It would be rather inelegant to have to have multiple representations with the same pixels and just different metadata.

So between the resolution independence concern, and the docs seemingly discouraging having different sized images in one file, this raises the core question above. What's the best way to arrange this for both drawing the image at different sizes in different places and resolution independence?

Best,
Benjamin Rister
_______________________________________________

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


  • Prev by Date: Re: [IPhone 3.0] How do I make a UITextField the first responder?
  • Next by Date: Re: need help about the touch event
  • Previous by thread: Re: [IPhone 3.0] How do I make a UITextField the first responder?
  • Next by thread: How to keep the last tree item of NSOutlineView in the most bottom of a Sidebar?
  • Index(es):
    • Date
    • Thread