Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 23, 2012, 01:19 PM   #1
silvercircle
macrumors member
 
Join Date: Nov 2010
Image on NSButtons not displaying @2x variants

I created images twice the size of that standard images to put on my buttons, and I named them "name@2x.png". I create my dialog with interface builder and set the image to use name.png.

When I try this with a small test project, the high rez images are used when I move the dialog to a scaled HiDPI monitor.

With my larger project, it simply won't work, the low res images are always used, but Images I on a toolbar in the same program do switch between high rez and low rez. So, it's not because I use the Display Manger or Carbon or Quickdraw because in that case the toolbar images would also not work.

What could be the reason for this? I tried everything I could think of.
silvercircle is offline   0 Reply With Quote
Old Dec 23, 2012, 07:23 PM   #2
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Quote:
Originally Posted by silvercircle View Post
I created images twice the size of that standard images to put on my buttons, and I named them "name@2x.png". I create my dialog with interface builder and set the image to use name.png.

When I try this with a small test project, the high rez images are used when I move the dialog to a scaled HiDPI monitor.

With my larger project, it simply won't work, the low res images are always used, but Images I on a toolbar in the same program do switch between high rez and low rez. So, it's not because I use the Display Manger or Carbon or Quickdraw because in that case the toolbar images would also not work.

What could be the reason for this? I tried everything I could think of.
The image name must not include the ".png" suffix. "name.png" will load "name.png". Always. Plain "name" will load the most suitable image that starts with "name". for example "name@2x.png". Same if you use "imageNamed" in code.
gnasher729 is offline   0 Reply With Quote
Old Dec 24, 2012, 02:25 AM   #3
silvercircle
Thread Starter
macrumors member
 
Join Date: Nov 2010
Quote:
Originally Posted by gnasher729 View Post
The image name must not include the ".png" suffix. "name.png" will load "name.png". Always. Plain "name" will load the most suitable image that starts with "name". for example "name@2x.png". Same if you use "imageNamed" in code.
Thanks, this fixed it. I just selected the file name Interface Builder presented in the popup.
You saved me a lot of time!

Happy holidays.
silvercircle is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Tags
@2x not showing, retina display

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhone variants magilla iPhone Tips, Help and Troubleshooting 2 Jan 14, 2014 02:05 PM
Emails displaying wrong remote image G.Alby Mac OS X 10.7 Lion 0 Jan 24, 2013 08:46 AM
OS-neutral: Why do Mac variants of PC games always require better hardware? LOLZpersonok Mac and PC Games 22 Dec 31, 2012 08:45 AM
NSButtons leave artefacts when used as subviews of a custom toolbar view demianturner Mac Programming 0 Sep 26, 2012 03:39 AM
different behavior when displaying image and video i018242 MacBook Pro 2 Aug 19, 2012 09:27 PM

Forum Jump

All times are GMT -5. The time now is 09:21 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC