It is currently April 18th, 2024, 12:32 am

Layer

Get help with creating, editing & fixing problems with skins
yukikawamomo
Posts: 1
Joined: March 16th, 2023, 12:25 pm

Layer

Post by yukikawamomo »

HI, i don't know a lot about code so i need help. I make .ini for layer and it worked but i using laptop and i set my scale is 125% so it make my layer become bigger i want it match with my scale how to do that. This is my code

Code: Select all

[Rainmeter]
Update=-1

[ReWall]
Meter=Image
ImageName=1.png
W=1920 
H=1080 
Tile=0
PreserveAspectRatio=0
LoadOrder=-1
Last edited by SilverAzide on March 16th, 2023, 4:47 pm, edited 2 times in total.
Reason: Please use code tags when posting code. It's the </> button.
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Layer

Post by Yincognito »

yukikawamomo wrote: March 16th, 2023, 12:28 pm HI, i don't know a lot about code so i need help. I make .ini for layer and it worked but i using laptop and i set my scale is 125% so it make my layer become bigger i want it match with my scale how to do that. This is my code

Code: Select all

[Rainmeter]
Update=-1

[ReWall]
Meter=Image
ImageName=1.png
W=1920 
H=1080 
Tile=0
PreserveAspectRatio=0
LoadOrder=-1
For your case (see the monitor built in variables in Rainmeter):

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[ReWall]
Meter=Image
ImageName=1.png
X=#SCREENAREAX#
Y=#SCREENAREAY#
W=#SCREENAREAWIDTH#
H=#SCREENAREAHEIGHT#
Tile=0
PreserveAspectRatio=0
LoadOrder=-1
DynamicVariables=1
For a more general case, this should provide some DPI / Scaling information as well, but whether the actual scaling is detected by the AppliedPI or the DPIValue measure (I set up the latter to override the former in such cases), as well as the value of the Monitor or Scaling variables used in the DPIValue measure, will depend on the user's particular system (the below is how it looks for mine):

Code: Select all

[Variables]
Monitor=BOE094A0_11_07E4_61^13B12C29BB6619B6E6B383B11D52D2EC
Scaling=100

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Measures---

[AppliedDPI]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Control Panel\Desktop\WindowMetrics
RegValue=AppliedDPI
IfCondition=(AppliedDPI=96)
IfTrueAction=[!SetVariable Scaling 100][!UpdateMeter *][!Redraw]

[DPIValue]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Control Panel\Desktop\PerMonitorSettings\#Monitor#
RegValue=DpiValue
IfCondition=(DPIValue=4294967295)
IfTrueAction=[!SetVariable Scaling 100][!UpdateMeter *][!Redraw]
IfCondition=(DPIValue=0)
IfTrueAction=[!SetVariable Scaling 125][!UpdateMeter *][!Redraw]
IfCondition=(DPIValue=1)
IfTrueAction=[!SetVariable Scaling 150][!UpdateMeter *][!Redraw]
IfCondition=(DPIValue=2)
IfTrueAction=[!SetVariable Scaling 175][!UpdateMeter *][!Redraw]

---Meters---

[SomeImage]
Meter=Image
ImageName=#@#SomeImage.jpg
X=#SCREENAREAX#
Y=#SCREENAREAY#
W=#SCREENAREAWIDTH#
H=#SCREENAREAHEIGHT#
Tile=0
PreserveAspectRatio=0
LoadOrder=-1
DynamicVariables=1

[DPIData]
Meter=String
X=(#SCREENAREAX#+#SCREENAREAWIDTH#/2)
Y=(#SCREENAREAY#+#SCREENAREAHEIGHT#/2)
FontFace=Tahoma
FontSize=16
FontColor=255,255,255,255
FontWeight=700
StringAlign=CenterCenter
AntiAlias=1
MeasureName=AppliedDPI
MeasureName2=DPIValue
Text=AppliedDPI = %1#CRLF#DPIValue = %2#CRLF#Scaling = #Scaling#
DynamicVariables=1
The bottom line is that, if one is using the Rainmeter's built in monitor variables with DynamicVariables=1 on the meter, the adjustment to the new scaling should happen automatically. In case one still wants to know the scaling amount, checking one of the registry values from the measures above (where #Monitor# depends on which of your monitors in that registry path reacts when scaling changes, something you'll have to test yourself) will offer the desired info. Apparently, Windows sets the relevant registry value to 0 when it's the "recommended" one, with the values above it in the list being preceeding negative ones (in reality, long integer positive values close to the maximum for the type due to type casting and such) and the values below it in the list being succeeding positive ones.

As for the overall topic of DPI in Rainmeter, read here.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth