views:

36

answers:

1

Okay, a REALLY fundamental question about window sizes here...

If I create an NSWindow in IB, set its size to 216 x 144 points (exactly 3 inches by 2 inches) then print the window, it measures exactly what I set it to in IB. However, the onscreen display size measures approximately 156 x 105 points.

What causes this, and is there any way to force the window to display at the actual size onscreen? I ultimately want to draw to this (semi-transparent) window then use it as a full-sized overlay for comparison against a separately loaded scanned image of known size.

+1  A: 

I'm going to guess that the DPI (aka PPI) setting in your OS is wrong, and so your display itself is mis-calibrated causing stuff drawn on the screen to be smaller than it really is. If your display is "high resolution" this is the likely cause. This is why "everything looks small" or you can "get more screen real-estate" on high-res displays. It's because the thing is mis-calibrated. Once your OS's DPI is set to match the screen's actual DPI, things drawn to the screen (in a resolution-independent manner) will display at the correct size.

Your printer is using the right DPI settings, so it's printing things at the right size.

In order to determine your actual DPI, you should be able to find display DPI calculators on the web. You should also be able to find instructions for your OS on how to change it. At least in windows, only vista and newer really handle different DPI settings well.

Benny Jobigan
Hi Benny.Yes, I think you're on the right track. However, I'm running a 20" iMac and the default resolution for this screen is 1680 x 1050 pixels. I can adjust it downwards of course, but -- just as happens on the Windows OS -- the font rendering etc. is visibly wrong. Also, while changing resolution does bring the window's onscreen size nearer to what was set in InterfaceBuilder there's still an unacceptable 10-20pt error for what I'm trying to achieve -- with no options to get the size 'right on', and unfortunately a "miss is as good as a mile" here. Thanks for your helpful input :-)
Bender
Ah. Unfortunately, I don't have any experience with macs or with objective c and the tools you're working with, so I can't help out much more than my previous suggestion. However, running your display through my favorite dpi calculator at http://members.ping.de/~sven/dpi.html, it says you're display is 99.06dpi.
Benny Jobigan