I see the manual says this about ConvertDialogToPixels:
Why divide by 4 or 8? Are these just arbitrary values?For the x dimension, the dialog units are multiplied by the average character width and then divided by 4.
For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.
I see ConvertDialogToPixels could be quite useful in scaling windows on different DPI settings. However, how do I arrive suitable dimensions when I am writing my app?
For example, let's suppose I want my window to be approx. 300 pixels wide on my development machine, but also want the window to be scaled suitably on client machines with differing DPIs. Do I just have to arrive at an equivalent width in "dialog units" by trial and error?
As an alternate stratedgy, I could use a #define to specify my development DPI, i.e.
#define BUILDDPI 96
and in my code divide the current screen dpi by this to arrive at a suitable scaling factor. It would have the advantage of yielding a scaling factor of 1 on my development machine, which would make positioning of controls easier.
What's a good DPI scaling stratedgy?