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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:42 AM.

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

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