• 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
Multi-rep toolbar image best practice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multi-rep toolbar image best practice


  • Subject: Multi-rep toolbar image best practice
  • From: email@hidden
  • Date: Thu, 29 Sep 2005 16:23:32 -0700

Hello list,

I want to make nice-looking Cocoa toolbar icons for both normal and small sizes. As I understand the docs, I need to use an NSImage that has multiple NSImageReps of the right dimensions (32 and 24 pixels square, respectively) and the toolbar will pick the right one. Please correct me if I'm wrong so far.

My question is how to get multiple NSImageReps in one image in a maintainable, IB- and Cocoa-friendly way.

I've seen references in the docs to loading an image that contains multiple reps in one file, but no details on how the file should be structured. Will a multi-frame GIF or TIF work for multiple sizes like this, or is that best suited to animation?

I can do something like the following in Cocoa:

NSImage *image = [NSImage imageNamed:@"big"];
[image addRepresentations:[[NSImage imageNamed:@"small"] representations];


But is there a better way? Is there a naming pattern such that I can name my image files toolbar_32.tif and toolbar_24.tif and ask for [NSImage imageNamed:@"toolbar"] or some such magic?

What's the best practice for toolbar images?

Thanks.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: SCM error with Subversion
  • Next by Date: Re: just C++ in xcode
  • Previous by thread: Re: Xcode beginner problem (tutorial build)
  • Next by thread: converting resource filename to absolute pathname
  • Index(es):
    • Date
    • Thread