Multi-rep toolbar image best practice
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