0

Taken from this page from Micrsoft, it states that The standard DPI settings are 100% (96 DPI), 125% (120 DPI), and 150% (144 DPI).

Now taking their example further down the page which has For example, if the user's DPI setting is 144 DPI, and you ask Direct2D to draw a 200 × 100 rectangle, the rectangle will be 300 × 150 physical pixels.

My confusion comes from the fact that if we scale everything up by 50%, but increase the DPI by 50%, should this not give an unchanged size in terms of what is seen on the screen, i.e the rendered size of a widget is unchanged if the widget is scaled up by 50%, but the DPI is also increased by 50%.

Let us give an example, if we have a 96 DPI setting on the computer and use the 200 x 100 rectangle from above, this means that the rectangle will be 200/96 = 2.08 inches high on the users monitor. Now, the user will go into the user settings and increase the scaling to 150% (Also changing the DPI to 144, states the documentation from above). Now that we have a 300 x 150 rectangle, the height will now be 300/144 = 2.08 inches high. The exact same height rendered on the users monitor.

The same applies to fonts. On a 96 DPI monitor, using one point sizing for our text (1 pt = 1/72 inch), this means that the height of our rendered to screen text will be 96/72 = 1.3 pixels high, meaning it is taking up 1.3/96 (1.38%) of an inch in height. Now, the user changes to 150% scaling (144 DPI) we can perform the same calculations. 144/72 = 2 pixels in height. 2/144 is roughly 1.38% of an inch in height. Meaning, that the rendered text has not changed in size.

Despite occupying more pixels, the DPI increase makes it so that the rendered size to the monitor is unchanged.

Now, I believe that I am wrong, from observing that changing the scale does actually increase the size of fonts and widgets, but could somebody please see where I have a misunderstanding here. Thanks.

J. Doe
  • 92
  • 5
  • Really depends on if the apps are DPI aware. – Anders Oct 04 '22 at 22:49
  • Keeping the physical size the same after switching to a new monitor with a higher resolution is the goal. The user increases the dpi so they still can read the text. – Hans Passant Oct 05 '22 at 00:20
  • @HansPassant My examples above were mostly on the same monitor. It was when the user went into the windows display and changed the scaling from 100% to 150%. Visually, it is increased, however the Microsoft docs says that changing to scaling to 150% also increases the DPI by 50%. My math from above makes is to that changing scaling to 150% shouldn't actually change the size of anything given the 50% DPI increase also, but it does so I am wrong, I am just not sure where. – J. Doe Oct 05 '22 at 00:45
  • Changing the dpi for an existing monitor doesn't make that much sense. But perhaps you want to sit further away from the screen and still comfortably read text. Or switch back-and-forth between users with one being visually impaired. The point is that output *will* be larger in that case since the actual monitor dpi didn't change. It still has the same pixel density. – Hans Passant Oct 05 '22 at 00:50
  • @HansPassant What do you mean by "Changing the dpi for an existing monitor doesn't make that much sense.". Isn't changing the scale also changing the DPI (quoting the Microsoft docs). So 100% to 150% would change the DPI from 96 to 144. Which, I believe is somewhat common behaviour. Are you saying we increase the logical DPI which somehow translates to a large image when mapped to physical pixels? – J. Doe Oct 05 '22 at 01:15
  • Yes, you're then changing the logical dpi but not the physical dpi. Either way, programs adjust their output accordingly, using more pixels as you increase the dpi. Since the physical dpi didn't change, that output looks larger. Just try it. – Hans Passant Oct 05 '22 at 01:28
  • @HansPassant When this page talks about how 150% = 144 dpi, (https://learn.microsoft.com/en-us/windows/win32/learnwin32/dpi-and-device-independent-pixels) why does it not mention that changing the scaling changes *logical dpi* and not physical. I guess it makes sense, you cannot really change the physical DPI as it is hardware. How would I redo my math so that 144DPI in logical translate do a correct 50% size increase in physical rendered display? – J. Doe Oct 05 '22 at 03:48

0 Answers0