The two sizes of the icons when displayed as "normal" and "small" are 32x32 and 
24x24. While the recommended way of handling this is to create a multi-image 
file as has been described previously, or to use a PDF, I find drawbacks in 
both approaches
- multi-image files are normally just the two sizes, and therefore don't have 
full support for resolution independence
- if you use a PDF, it has the resolution independence, but will look fuzzy at 
non-native resolutions

What I am experimenting with at the moment is using two PDFs that I have 
created to be pixel perfect at 32 and 24 pixels, and have created a subclass of 
NSToolbar which has the following:

- (void)setSizeMode:(NSToolbarSizeMode)sizeMode {
        [super setSizeMode:sizeMode];
        if ([self delegate] && [[self delegate] 
respondsToSelector:@selector(toolbarSizeModeChanged:)]) {
                [[self delegate] 
performSelector:@selector(toolbarSizeModeChanged:) withObject:self];
        }
}

Then in the toolbar delegate I ask for the sizeMode and from there I can set 
the min and max size as necessary, and set the image to the one that is pixel 
perfect for that size. I also use the correct sized image in the 
itemForIdentifier... method. It seems to be working fine, and means that I have 
both a pixel perfect rendering at the required size, and have automatic full 
resolution independence.

HTH.


Gideon


On 27/06/2010, at 8:14 AM, Paul Sanders wrote:

> I create my icons as vector graphics without worrying *at all* about pixel 
> boundaries and then scale them to fit at display time.  Life improved 
> markedly when I went this route.  Although they might not be as sharp as 
> 'pixel-perfect' bitmapped images it means I don't have to worry too much 
> about the exact size at which they will be displayed.  That said, my talents 
> are limited and my icons are pretty boring.  The alternative is to create 
> 'pixel-perfect' bitmaps in a bitmap editor at the size they will be 
> displayed, but it's hard work and I would only do it for a small image where 
> display quality is paramount.


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to