I recently started to switch between displays that have normal and high dpi. I use like 6 selfwritten Skins and the positions compared to each other is just not kept between dpi-s (its kept between resolutions) - compared to each other.
What are the strategies to counter this?
- make one skin out of all of them? (would be hard and clunky, but would be straightforward)
- somehow make every size unit in the skin dpi-dependent? Is there a variable that could be used for scale? I would like to use the same skins between displays.
It is currently April 26th, 2024, 7:47 pm
Skin positioning compared to each other on DPI change
-
- Posts: 10
- Joined: November 25th, 2009, 6:52 pm
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: Skin positioning compared to each other on DPI change
There's no way to know the DPI of a screen unless physically counted. (Or provided somehow from the Screen to the computer.)poisonborz wrote: ↑October 24th, 2018, 7:35 am I recently started to switch between displays that have normal and high dpi. I use like 6 selfwritten Skins and the positions compared to each other is just not kept between dpi-s (its kept between resolutions) - compared to each other.
What are the strategies to counter this?
- make one skin out of all of them? (would be hard and clunky, but would be straightforward)
- somehow make every size unit in the skin dpi-dependent? Is there a variable that could be used for scale? I would like to use the same skins between displays.
It is possible however, if you physically counted the DPI of your screen and put them in variables, one for each screen, to use those variables as scales for the skin. This less time consuming as you only have to count the DPI of all your screens and add 1 line of codes on each meter of your skins, in contrast to rewriting each skin for each monitor.
Here's an easy-to-use free site that counts the DPI depending on your screen's resolution and its diagonal:
http://dpi.lv/
-
- Posts: 10
- Joined: November 25th, 2009, 6:52 pm
Re: Skin positioning compared to each other on DPI change
Instead of DPI, is it possible to query the scale (eg 150%) that Windows is using? This plus the resolution would be enough for estimating the needed sizes.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Skin positioning compared to each other on DPI change
I believe a Registry measure using this key:
HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\AppliedDPI
Will return the DPI
96 DPI = 100%
120 DPI = 125%
144 DPI = 150%
192 DPI = 200%
As far as I can tell, this will be for the primary monitor only.
HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\AppliedDPI
Will return the DPI
96 DPI = 100%
120 DPI = 125%
144 DPI = 150%
192 DPI = 200%
As far as I can tell, this will be for the primary monitor only.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureDPI]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Control Panel\Desktop\WindowMetrics
RegValue=AppliedDPI
[MeterOne]
Meter=String
MeasureName=MeasureDPI
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
You do not have the required permissions to view the files attached to this post.
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: Skin positioning compared to each other on DPI change
I did some research and I stand corrected: You can calculate the DPI as it seems HWiNFO can get the physical dimensions of your screen... Then you simply do for examplepoisonborz wrote: ↑October 24th, 2018, 1:21 pm Instead of DPI, is it possible to query the scale (eg 150%) that Windows is using? This plus the resolution would be enough for estimating the needed sizes.
sqrt(1920^2+1080^2)=2.202
and then
sqrt(27^2+48^2)=55cm=~21inches
27 and 48 are my screens dimensions as seen in the picture, your's could be different.
do you have 2.202 pixels in 21 inches which means 105 DPI
So yea, you can use DPI for scale. But I can only imagine, that not all monitors provide this information.... Some older screen might not provide the information.
EDIT: jsmorley solution above should be way easier to work with. Go with that
You do not have the required permissions to view the files attached to this post.
Last edited by kyriakos876 on October 24th, 2018, 1:59 pm, edited 1 time in total.
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: Skin positioning compared to each other on DPI change
This doesn't return the actual DPI, rather the DPI that's closest to actual DPI because windows couldn't obviously make a layout for every single DPI so they use those 4 major ones.
It should do the trick tho.
-
- Posts: 10
- Joined: November 25th, 2009, 6:52 pm
Re: Skin positioning compared to each other on DPI change
Thank you all for all the research and extensive answers, this will surely be enough to get started!