How to understand logical DPI and physical DPI in QScreen?
-
-
@raven-worx I update the question, thank you for reply.
-
@willxli said in How to understand logical DPI and physical DPI in QScreen?:
@raven-worx I update the question, thank you for reply.
in my opinion you didnt read the docs nor you rewrote your question to be more precise :)
-
@willxli said in How to understand logical DPI and physical DPI in QScreen?:
What is logical DPI and physical DPI ?
Physical DPI:
DPI of your screen/deviceLogical DPI:
Appearance of your font or anything you display.Let's say you have a line with a length of 3px (3x1)... and it actually takes 3 physical pixels of "space" on your screen. If you double your avaiable physical pixels, your line and anything else would appear way smaller on the screen (-> resolution). Therefore you need to map logical pixels of your content to correct pixels of your screen (new width and height).
To stay with the example of a 3px line... If you double your physical pixels,you need to increase the logical pixels the line takes from 3 to 6 to make it look the same.
[Edit: You don't increase the logical pixels.. You just map the 3 (3x1) logical pixels to 6 (6x2) physical pixels of your new screen]I hope this is understandable... Correct me if I said something wrong here :)
-
If I am not mistaken the relation between the physical and logical pixels is the scaling factor (usually set by the operating system). For example, Apple's Retina displays usually have a scaling of 200%. Which means that for every logical pixel there are 2 physical pixels (actually 2 in x- and y-direction each; which makes 4 in total) inside your display.
You should try to change the scaling in your OS and then write a small toy program to see what physical and logical DPI you get. The physical DPI should be fixed.