• 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
Re: Image Sizing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image Sizing


  • Subject: Re: Image Sizing
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 31 Dec 2014 07:34:40 -0600

On Dec 31, 2014, at 7:04 AM, Charles Jenkins <email@hidden> wrote:

> First, am I right that there is no way to ask an NSToolbar or NSToolbarImage what size its graphic should be? In searching the documentation, I found it seems to say toolbar images come in two sizes, 32x32 or 24x24, and if they need to be different, the toolbar will pick the closest provided one and scale it. I hate hard-coding sizes like this, but am I right there's no other option?

Here are Apple's guidelines for designing graphics for toolbar items:
https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/ToolbarIcons.html

Note that there are two types of toolbar items, image items and view items, and they have different design requirements.  The two types are further explained elsewhere in the HIG:
https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/WindowTitleBarToolbar.html
https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/ControlsAll.html#//apple_ref/doc/uid/20000957-CH46-SW2


> Second, what about images in a Source View? Mine appear at 17x17 in the NIB. Are they always that size, even on a retina screen, or do I need to learn how to deal with the possibility of a changing size? I haven't yet been able to find any documentation on this at all, but that may only mean I used the wrong search keywords.

In the AppKit release notes for 10.7, in the section on NSTableView and NSOutlineView <https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKitOlderNotes/#10_7TableView>, under the header "Implementing Sidebar Source Lists with NSOutlineView" it says:

"There is no direct way to know the image size for the icons. If you use NSTableCellView in a View Based NSOutlineView, then the cell will automatically be setup with the correct sizes when the rowSizeStyle is set. If this is not sufficient, then you can make the assumption for the following sizes: NSTableViewRowSizeStyleSmall = 16x16, NSTableViewRowSizeStyleMedium = 18x18, and NSTableViewRowSizeStyleLarge=32x32."

Don't forget to test your source view at each of the possible settings for "Sidebar icon size" in the General pane of System Preferences.

> Are they always that size, even on a retina screen, or do I need to learn how to deal with the possibility of a changing size?

Sizes of screens, windows, views, and images are generally measured in points, not pixels.  Same with all of the drawing primitives.  Points are a virtualized coordinate system.  Things don't change their size in points when displayed in high-resolution.

Regards,
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


References: 
 >Image Sizing (From: Charles Jenkins <email@hidden>)

  • Prev by Date: Image Sizing
  • Next by Date: Bug in removeStatusItem
  • Previous by thread: Image Sizing
  • Next by thread: Bug in removeStatusItem
  • Index(es):
    • Date
    • Thread