It is currently April 26th, 2024, 7:47 pm

Skin positioning compared to each other on DPI change

Get help with creating, editing & fixing problems with skins
User avatar
poisonborz
Posts: 10
Joined: November 25th, 2009, 6:52 pm

Skin positioning compared to each other on DPI change

Post by poisonborz »

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.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Skin positioning compared to each other on DPI change

Post by kyriakos876 »

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.
There's no way to know the DPI of a screen unless physically counted. (Or provided somehow from the Screen to the computer.)
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/
User avatar
poisonborz
Posts: 10
Joined: November 25th, 2009, 6:52 pm

Re: Skin positioning compared to each other on DPI change

Post by poisonborz »

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.
User avatar
jsmorley
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

Post by jsmorley »

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.

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
1.png
You do not have the required permissions to view the files attached to this post.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Skin positioning compared to each other on DPI change

Post by kyriakos876 »

poisonborz 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.
I did some research and I stand corrected:
k.png
You can calculate the DPI as it seems HWiNFO can get the physical dimensions of your screen... Then you simply do for example
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 :FingerUp
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.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Skin positioning compared to each other on DPI change

Post by kyriakos876 »

jsmorley wrote: October 24th, 2018, 1:52 pm 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%
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.
User avatar
poisonborz
Posts: 10
Joined: November 25th, 2009, 6:52 pm

Re: Skin positioning compared to each other on DPI change

Post by poisonborz »

Thank you all for all the research and extensive answers, this will surely be enough to get started!