Re: Image Sizing
Re: Image Sizing
- Subject: Re: Image Sizing
- From: Uli Kusterer <email@hidden>
- Date: Thu, 01 Jan 2015 15:55:08 +0100
On 31 Dec 2014, at 14:04, Charles Jenkins <email@hidden> wrote:
> I have a non-retina Mac and no experience knowing what happens to graphics when used on a retina screen. I bought PixelCut's PaintCode as a Christmas present to myself so that my images could be made resolution-independent, but I'm having quite a bit more difficulty getting good results than I imagined, partly because of Cocoa issues.
You’re aware that you can usually try out Retina on a non-Retina Mac, right? As long as you have a sufficiently large screen, you can use Quartz Debug.app to turn on Retina sizes for your screen, then choose a Retina resolution in the Displays System Preference (Resolution: Scaled, then you get a list of resolutions).
It’s a bit annoying because if you switch a 2560x1440 screen to 2x, you get all applications thinking they’re 1280x720, which is just a tad too small to pass for a MacBook Air 11” (1366x768), so some stuff is cut off, but all rendering in your app will be Retina, so you can see what happens, if at a magnified size.
You might also be able to run AirDisplay or something equivalent on your iPad to add a (slow) second Retina display to your Mac, it’s been ages since I even considered that option.
> 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?
All images on Retina essentially work like icons. You provide 1x (32x32px and 24x24px) variants of your images, and also add 2x variants (which would be 64x64px and 48x48px, so still 32x32pt and 24x24pt). You can just add multi-representation TIFFs that contain all the sizes, and NSImage will pick the best one for where it’s drawn. PaintCode should be able to generate such multi-resolution TIFFs for you (Opacity certainly does, and has presets for the various icon types that export all required sizes).
> 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.
You can probably assume the *point* size will stay this way, but you still need to provide 2x representations.
Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere...”
http://zathras.de
_______________________________________________
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