2

When I load my images in Interface Builder, and choose the scaling as: "None", it adds the image scaled down a lot! I'd say almost 70% !!

Using "Proportionally up or down", and settings the image view width EXACTLY the same as the image width. So, that's the real image size:

enter image description here

Now, without changing the image well size or anything, I just change scaling to "None". Expected behavior is no change, because the image is already at it's regular size! BUT! Here is the result:

enter image description here

Look how small it is!! The evidence that the image size is really the one above is, notice how it is not blurry or anything from being this size.

Now, why is this behavior happening!!

NOTE: I first started developing this app using Xcode 4.2 , then moved to Xcode 4.3 now, but the problem is always the same. Even when started a new fresh Xcode 4.3 project (Cocoa).


EDIT:

As suggested by Thomases in the comments, I went and designed a new image from scratch with 72 DPI .. Here is the result:

enter image description here

Thanks, that was truly awesome and helpful! ... Now, I have to look for a way to fix/change all my images to 72 DPI :( ... I have imagemagick, so it should be straight forward actually :).


EDIT2:

For those interested in the imagemagick script:

convert -units pixelsperinch image.png -density 72 image.png
Mazyod
  • 22,319
  • 10
  • 92
  • 157
  • 2
    I don't know, but +1 for the way you talk about this problem, I can feel the indignation in your post! :D – Clafou Apr 27 '12 at 14:18
  • 1
    This is happening with all images or just with this? What is size of Your image? Try to create new *NSImageView* (empty, without outlets etc.) and place You image in it. – Justin Boo Apr 27 '12 at 15:18
  • Am very indignant >.< .. Thanks for the suggestion, @Justin, but the problem is with all images + the programmatic approach has the same result.. – Mazyod Apr 27 '12 at 17:57
  • 2
    There are two sizes associated with an image, the pixel dimensions and the "real world" dimensions (its size in inches or centimeters). The DPI of the image governs the mapping between them. What's the DPI of your image? In Cocoa, views nominally have a DPI of 72. If the image has a higher DPI, then it will be displayed in fewer pixels than you might expect. For example, an image that's 300 pixels wide but with a DPI of 300 should be displayed as an inch across. When that image is displayed in a 72 DPI view it should still be an inch across. That means the pixels will have to be scaled down. – Ken Thomases Apr 28 '12 at 01:02
  • 1
    @KenThomases, you should add that as an answer because I'm pretty sure that's the problem. – Rob Keniger Apr 28 '12 at 01:55
  • ++Ken. As much as I appreciate your answer, I despise apple for making the image views dependent on the DPI of the image! >.< .. I wish it was just a flag that could be turned off or something :(. – Mazyod Apr 28 '12 at 05:34
  • Heh, know I know why this problem exists ... After the release of the MBP with Retina Display – Mazyod Jul 09 '12 at 20:00

0 Answers0