问题
I have a dell laptop latitude 5420.
The built-in monitor has a width of 12.20 inches and a height of 6.69 6,86 inches.
OS is Windows7. The screen resolution is set to 1600 by 900 (prefered resolution).
Additionally Windows7 is configured with a "Set custom text size (DPI)" of 100% (9 point Segoe UI at 96 pixels per inch). I think this means windows7 thinks 1 inch of my monitor uses 96 pixels.
If I divide 1600 pixels by 12.20 inches (or 900 by 6,86) it results around 131,1.
What should be the expected DPI of the system? The horizontal one? the vertical one? Given this configuration a square would be seen as a rectangle in my screen? Am I missing something?
Original question has no sense now. Resolution and physical size follows the same 16:9 format now.
Now the question it bugs me is it seems the screen in reality has around 131 pixels per inch, but OS thinks it has 96 pixels by inch. If I tell a program to write a line of 1 inch how many pixels will be printed on the screen? 96 or 131? If I tell a program to write 131 pixels, and I put a ruler on the screen what would I measure?
Reason for edit: Sorry for any incovenience. I recheck the measures using a ruler and I did an error in the vertical measure.
回答1:
GetDeviceCaps is meant to return this information (HORZSIZE
/VERTSIZE
, LOGPIXELSX
/LOGPIXELSY
). However,
GetDeviceCaps
reports info that the display driver provides. If the display driver declines to report any info,GetDeviceCaps
calculates the info based on fixed calculations. If the display driver reports invalid info,GetDeviceCaps
returns the invalid info. Also, if the display driver declines to report info,GetDeviceCaps
might calculate incorrect info because it assumes either fixed DPI (96 DPI) or a fixed size (depending on the info that the display driver did and didn’t provide). Unfortunately, a display driver that is implemented to the Windows Display Driver Model (WDDM) (introduced in Windows Vista) causes GDI to not get the info, so GetDeviceCaps must always calculate the info.
For my Windows 7 laptop, HORZSIZE
and VERTSIZE
are completely wrong.
回答2:
The 96 pixels/inch is kind of virtual and has nothing to do with the actual screen size. Assume you have a 4000 * 3000 pixel screen, LOGPIXELX will still return 96 (with standard settings). Please read this article for a comprehensive explanation.
BTW on my computer HORZSIZE and VERTSIZE are also completely wrong.
来源:https://stackoverflow.com/questions/11643886/about-monitor-physical-size-screen-resolution-dpi