It is currently October 15th, 2019, 10:38 pm

background image scaling

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 8828
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: background image scaling

balala » April 8th, 2019, 4:34 pm

balala wrote:
April 6th, 2019, 8:41 pm
As I said

I'll left this for tomorrow, but I'll take a look.
I promised tomorrow, but only today I got it working as I think it should.
So, please try out the following SkinHeight within the [Rainmeter] section: SkinHeight=(100+90*(#Scale#-1)+40*#Scale#*Clamp(#SkinState#,0,1)).
Note three more things:
  • The Author option is deprecated into the [Rainmeter] section. It was moved to [Metadata]. Move it you as well.
  • AppVersion is completely deprecated. Remove it from the [Rainmeter] section.
  • The [!UpdateMeasure "MeasureSkinState"] bangs are useless into both LeftMouseUpAction options of [meterHideGraphsClickableRegion] and [meterShowGraphsClckableRegion] meters. Remove them:

    Code: Select all

    [meterHideGraphsClickableRegion]
    ...
    LeftMouseUpAction=[!SetVariable SkinState "0"][!WriteKeyValue Variables SkinState "0"][!Refresh]
    
    ...
    
    [meterShowGraphsClckableRegion]
    ...
    LeftMouseUpAction=[!SetVariable SkinState "1"][!WriteKeyValue Variables SkinState "1"][!Refresh]
    The mentioned !UpdateMeasure bangs are not needed anymore, because when you click the button, the skin is refreshed, so no need to update the measure, then immediately refresh the skin.
User avatar
Pul53dr1v3r
Posts: 231
Joined: July 30th, 2014, 10:30 am

Re: background image scaling

Pul53dr1v3r » April 8th, 2019, 6:45 pm

balala wrote:
April 8th, 2019, 4:34 pm
I promised tomorrow, but only today I got it working as I think it should.
.
.
.
Np. mate. I'm not in a rush. I replaced the code with this one and now the vertical arrangement is fit at any scales but there still exists the issue where the right side of the skin is narrower and the content is out of the bg space. So, the content is ok, but the bg isn't at any Scales from 2 and up. Do we have to make SkinWeight as well?
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 8828
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: background image scaling

balala » April 8th, 2019, 7:32 pm

Pul53dr1v3r wrote:
April 8th, 2019, 6:45 pm
I replaced the code with this one and now the vertical arrangement is fit at any scales but there still exists the issue where the right side of the skin is narrower and the content is out of the bg space.
I doubt, because I don't have such problems. Everything is working well, with any scale. For example here you have what I got for Scale=3:
Test.png
So, here is the complete code. Please try this out too:

Code: Select all

;READ THE [Variables] SECTION BELOW FOR SETUP INFORMATION
[Metadata]
Author=Pul53dr1v3r

[Rainmeter]
Update=1000
Background=#@#Background.png
SkinHeight=(100+90*(#Scale#-1)+40*#Scale#*Clamp(#SkinState#,0,1))
SkinWidth=(#BgWidth#*#Scale#)
AccurateText=1
BackgroundMode=3
BackgroundMargins=0,34,0,13

[Variables]
;CPU Name or Title for widget/gadget
CPUName=cpu-ram
FontFamily=Trebuchet MS
textSize=8
colorBar=255,140,0,200
colorText=255,255,255,205
EmptyBarColor=255,255,255,25
barHeight=1
barWidth=90
SkinState=0
RamHistState=0
CpuHistState=1
TempHistState=0
@Include=#@#\HWiNFO.inc
BgHeight=150
BgWidth=210
Scale=1

;=========================
;CPU AND RAM INFO
;=========================

[styleTitle]
StringAlign=CENTER
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#FontFamily#
FontSize=10
AntiAlias=1
;ClipString=1

[styleCenterText]
StringAlign=Center
StringCase=NONE
StringStyle=BOLD
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#FontFamily#
FontSize=#textSize#
AntiAlias=1
;ClipString=1

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#FontFamily#
FontSize=8
AntiAlias=1

[styleRightText]
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#FontFamily#
FontSize=8
AntiAlias=1

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=104
Y=12
H=100
Text="#CPUNAME#"
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;[""""""""""""""""""""""""""""""[[CPU_Temperature]]""""""""""""""""""""""""""""""]

[CPUTotalTemp]
Meter=STRING
MeasureName=MCPUTemp
MeterStyle=styleCenterText
Text="%1°C"
FontColor=[MCPUTempCalc]
x=104
Y=38
W=1
H=1
DynamicVariables=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[MCPUTemp]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#HWiNFO-MOBO-SensorId#
HWiNFOSensorInstance=#HWiNFO-MOBO-SensorInstance#
HWiNFOEntryId=#HWiNFO-MOBO-CPU-Temp#
HWiNFOType=CurrentValue
HWiNFOLogHandler=0
MinValue=0
MaxValue=100

[MCPUTempCalc]
Measure=Calc
Formula=MCPUTemp< 25 ? -1 : (MCPUTemp < 40 ? -2 : (MCPUTemp < 50 ? -3 : (MCPUTemp < 60 ? -4 : -5)))
Substitute="-1":"255,255,255","-2":"255,255,102","-3":"255,153,51","-4":"255,0,0","-5":"204,0,0"

;[""""""""""""""""""""""""""""""[[CPU_Meters]]""""""""""""""""""""""""""""""]

[TotalCPUUsageText]
Meter=STRING
MeterStyle=styleLeftText
Text="CPU:"
X=9
Y=40
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[CPUTotalBarGraphUsage]
Meter=BAR
MeasureName=MCLOADTOTAL
BarColor=[CPUBARWARNT]
SolidColor=#EmptyBarColor#
BarOrientation=HORIZONTAL
X=9
Y=52
W=190
H=2
DynamicVariables=1
Autoscale=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[TotalCPUUsagePercent]
Meter=String
MeasureName=CPUPERCENTCALC
MeterStyle=styleRightText
X=199
Y=38
Text="[%1%]"
NumofDecimals=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;CPU Usage Measures
[MCLOADTOTAL]
Measure=CPU
Processor=0

;CPU Usage percent measures
[CPUPERCENTCALC]
Measure=Calc
Formula=MCLOADTOTAL * 1

;CPU Usage Bar Warning
[CPUBARWARNT]
Measure=Calc
Formula=CPUPERCENTCALC> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

;[""""""""""""""""""""""""""""""[[CPU_Clock]]""""""""""""""""""""""""""""""]

[MCLOCK]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#HWiNFO-CPU0-SensorId#
HWiNFOSensorInstance=#HWiNFO-CPU0-SensorInstance#
HWiNFOEntryId=#HWiNFO-CPU0-Clock#
HWiNFOType=CurrentValue

[MeterMHz]
Meter=STRING
MeasureName=MCLOCK
MeterStyle=styleLeftText
FontColor=255,255,255,100
StringStyle=Normal
;FontSize=7
;FontFace=Arial
Text="Clock: %1 MHz"
X=9
Y=56
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;[""""""""""""""""""""""""""""""[[CPU_Fan]]""""""""""""""""""""""""""""""]

[CPUFanText]
Meter=STRING
MeasureName=CPUFAN0
MeterStyle=styleRightText
FontColor=255, 255, 255,100
StringStyle=Normal
;FontSize=7
;FontFace=Arial
Text="FAN: %1rpm"
X=199
Y=r
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[CPUFAN0]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#HWiNFO-MOBO-SensorId#
HWiNFOSensorInstance=#HWiNFO-MOBO-SensorInstance#
HWiNFOEntryId=#HWiNFO-MOBO-CPU-Fan#
HWiNFOType=CurrentValue
HWiNFOLogHandler=0
MinValue=0
MaxValue=5000

;[""""""""""""""""""""""""""""""[[RAM]]""""""""""""""""""""""""""""""]

[MeasureRAMTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=600

[MeasureRAMUsed]
Measure=PhysicalMemory

[MeasureRAMFree]
Measure=PhysicalMemory
InvertMeasure=1

[RAMUsageLabel]
Meter=String
MeterStyle=styleLeftText
Text="RAM:"
x=9
y=18r
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[RAMUsage]
Meter=BAR
MeasureName=MeasureRAMUsed
X=9
Y=0R
W=190
H=1
BarColor=[RAMWarn]
SolidColor=#EmptyBarColor#
BarOrientation=HORIZONTAL
DynamicVariables=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[RAMUsedGB]
Meter=STRING
MeterStyle=styleCenterText
MeasureName=MeasureRAMTotal
MeasureName2=MeasureRAMUsed
MeasureName3=MeasureRAMFree
;FontColor=255, 255, 255, 100
NumofDecimals=1
X=104
Y=-12r
Text="%2B/%1B"
Autoscale=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[RAMUsagePercent]
Meter=STRING
MeasureName=MeasureRAMUsed
MeterStyle=styleRightText
X=199
Y=-2r
;H=18
Text="[%1%]"
NumofDecimals=0
Percentual=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;[""""""""""""""""""""""""""""""[[RAM_Warning_Levels]]""""""""""""""""""""""""""""""]

[measureRAMGBCalc]
Measure=Calc
Formula=MeasureRAMUsed * 100 / MeasureRAMTotal

[measureRAMGBCalc2]
Measure=Calc
Formula=measureRAMGBCalc
MinValue=0
MaxValue=100
Percentual=1

[RAMWarn]
Measure=Calc
Formula=measureRAMGBCalc2> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

;[""""""""""""""""""""""""""""""[[Histograms]]""""""""""""""""""""""""""""""]

[CpuHistogram]
Meter=Histogram
MeasureName=MCLOADTOTAL
GraphStart=Left
X=10
Y=-40
W=186
H=25
Autoscale=1
Antialias=1
PrimaryColor=176,196,222,150
;SolidColor=255,255,255,15
Group=Graphs
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[RamHistogram]
Meter=Histogram
MeasureName=MeasureRAMUsed
GraphStart=Left
X=10
Y=-40
W=186
H=25
Autoscale=1
Antialias=1
PrimaryColor=176,196,222,150
;SolidColor=255,255,255,15
Group=Graphs
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[TempHistogram]
Meter=Histogram
MeasureName=MCPUTemp
GraphStart=Left
X=10
Y=-40
W=186
H=25
Autoscale=1
Antialias=1
PrimaryColor=176,196,222,150
;SolidColor=255,255,255,15
Group=Graphs
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;(""""""""""((UniqueHistBg))"""""""""")

[HistogramBackground]
Meter=Image
X=10
Y=-40
W=186
H=25
;PrimaryColor=176,196,222,150
SolidColor=255,255,255,15
Group=Graphs
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;(""""""""""((TEMP))"""""""""")

[HideTempHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=74
Y=-40
H=7
FontColor=255,140,0,200
Text=TMP
LeftMouseUpAction=[!SetVariable TempHistState "0"][!WriteKeyValue Variables TempHistState "0"][!UpdateMeasure "MeasureTempHistState"]
Group=TButtons
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[ShowTempHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=r
Y=-40
H=7
FontColor=255,255,255,50
Text=TMP
LeftMouseUpAction=[!SetVariable TempHistState "1"][!WriteKeyValue Variables TempHistState "1"][!SetVariable CpuHistState "0"][!WriteKeyValue Variables CpuHistState "0"][!SetVariable RamHistState "0"][!WriteKeyValue Variables RamHistState "0"][!UpdateMeasure "MeasureTempHistState"][!UpdateMeasure "MeasureCpuHistState"][!UpdateMeasure "MeasureRamHistState"]
Hidden=1
Group=TButtons
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[MeasureTempHistState]
Measure=Calc
Formula=#TempHistState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "TempHistogram"][!ShowMeter "ShowTempHistogram"][!HideMeter "HideTempHistogram"][!Update]
IfFalseAction=[!ShowMeter "TempHistogram"][!HideMeter "ShowTempHistogram"][!ShowMeter "HideTempHistogram"][!Update]
DynamicVariables=1
Disabled=1

;(""""""""""((CPU))"""""""""")

[HideCpuHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=104
Y=-40
H=7
FontColor=255,140,0,200
Text=CPU
LeftMouseUpAction=[!SetVariable CpuHistState "0"][!WriteKeyValue Variables CpuHistState "0"][!UpdateMeasure "MeasureCpuHistState"]
Group=TButtons
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[ShowCpuHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=r
Y=-40
H=7
FontColor=255,255,255,50
Text=CPU
LeftMouseUpAction=[!SetVariable CpuHistState "1"][!WriteKeyValue Variables CpuHistState "1"][!SetVariable TempHistState "0"][!WriteKeyValue Variables TempHistState "0"][!SetVariable RamHistState "0"][!WriteKeyValue Variables RamHistState "0"][!UpdateMeasure "MeasureCpuHistState"][!UpdateMeasure "MeasureTempHistState"][!UpdateMeasure "MeasureRamHistState"]
Hidden=1
Group=TButtons
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[MeasureCpuHistState]
Measure=Calc
Formula=#CpuHistState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "CpuHistogram"][!ShowMeter "ShowCpuHistogram"][!HideMeter "HideCpuHistogram"][!Update]
IfFalseAction=[!ShowMeter "CpuHistogram"][!HideMeter "ShowCpuHistogram"][!ShowMeter "HideCpuHistogram"][!Update]
DynamicVariables=1
Disabled=1

;(""""""""""((RAM))"""""""""")

[HideRamHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=134
;Y=([MeterMHz:Y]+60)
Y=-40
H=7
FontColor=255,140,0,200
Text=RAM
LeftMouseUpAction=[!SetVariable RamHistState "0"][!WriteKeyValue Variables RamHistState "0"][!UpdateMeasure "MeasureRamHistState"]
Group=TButtons
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[ShowRamHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=r
Y=-40
H=7
FontColor=255,255,255,50
Text=RAM
LeftMouseUpAction=[!SetVariable RamHistState "1"][!WriteKeyValue Variables RamHistState "1"][!SetVariable TempHistState "0"][!WriteKeyValue Variables TempHistState "0"][!SetVariable CpuHistState "0"][!WriteKeyValue Variables CpuHistState "0"][!UpdateMeasure "MeasureRamHistState"][!UpdateMeasure "MeasureTempHistState"][!UpdateMeasure "MeasureCpuHistState"]
Hidden=1
Group=TButtons
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[MeasureRamHistState]
Measure=Calc
Formula=#RamHistState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "RamHistogram"][!ShowMeter "ShowRamHistogram"][!HideMeter "HideRamHistogram"][!Update]
IfFalseAction=[!ShowMeter "RamHistogram"][!HideMeter "ShowRamHistogram"][!ShowMeter "HideRamHistogram"][!Update]
DynamicVariables=1
Disabled=1

;[""""""""""""""""""""""""""""""[[Collapse-Expand]]""""""""""""""""""""""""""""""]

[meterHideGraphs]
Meter=Image
ImageName=#@#Images\left.png
X=185
Y=15
W=10
H=10
ImageTint=255,255,255,150
;LeftMouseUpAction=[!SetVariable SkinState "0"][!WriteKeyValue Variables SkinState "0"][!UpdateMeasure "MeasureSkinState"]
TooltipText=Hide graph
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[meterHideGraphsClickableRegion]
Meter=Image
Solidcolor=0,0,0,0
X=([meterHideGraphs:X] * #Scale#)
Y=([meterHideGraphs:Y] * #Scale#)
H=([meterHideGraphs:H] * #Scale#)
W=([meterHideGraphs:W] * #Scale#)
LeftMouseUpAction=[!SetVariable SkinState "0"][!WriteKeyValue Variables SkinState "0"][!Refresh]
UpdateDivider=1
DynamicVariables=1

[meterShowGraphs]
Meter=Image
ImageName=#@#Images\right.png
X=185
Y=15
H=10
W=10
ImageTint=255,255,255,150
;LeftMouseUpAction=[!SetVariable SkinState "1"][!WriteKeyValue Variables SkinState "1"][!UpdateMeasure "MeasureSkinState"]
TooltipText=Show graph
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[meterShowGraphsClckableRegion]
Meter=Image
Solidcolor=0,0,0,0
X=([meterShowGraphs:X] * #Scale#)
Y=([meterShowGraphs:Y] * #Scale#)
H=([meterShowGraphs:H] * #Scale#)
W=([meterShowGraphs:W] * #Scale#)
LeftMouseUpAction=[!SetVariable SkinState "1"][!WriteKeyValue Variables SkinState "1"][!Refresh]
UpdateDivider=1
Hidden=1
DynamicVariables=1

[MeasureSkinState]
Measure=Calc
Formula=#SkinState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!DisableMeasure "MeasureTempHistState"][!DisableMeasure "MeasureCpuHistState"][!DisableMeasure "MeasureRamHistState"][!HideMeterGroup "Graphs"][!HideMeterGroup "TButtons"][!ShowMeter "meterShowGraphs"][!ShowMeter "meterShowGraphsClckableRegion"][!HideMeter "meterHideGraphs"][!HideMeter "meterHideGraphsClickableRegion"][!SetOptionGroup "Graphs" "Y" "0"][!SetOptionGroup "TButtons" "Y" "0"][!HideMeter "HistogramBackground"][!Update]
IfFalseAction=[!EnableMeasure "MeasureTempHistState"][!EnableMeasure "MeasureCpuHistState"][!EnableMeasure "MeasureRamHistState"][!HideMeter "meterShowGraphs"][!HideMeter "meterShowGraphsClckableRegion"][!ShowMeter "meterHideGraphs"][!ShowMeter "meterHideGraphsClickableRegion"][!SetOption TempHistogram Y "([MeterMHz:Y]+35)"][!SetOption CpuHistogram Y "([MeterMHz:Y]+35)"][!SetOption RamHistogram Y "([MeterMHz:Y]+35)"][!SetOption HideTempHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!SetOption ShowTempHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!SetOption HideCpuHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!SetOption ShowCpuHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!SetOption HideRamHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!SetOption ShowRamHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!ShowMeter "HistogramBackground"][!SetOption HistogramBackground Y "([MeterMHz:Y]+35)"][!Update]
DynamicVariables=1
Pul53dr1v3r wrote:
April 8th, 2019, 6:45 pm
Do we have to make SkinWeight as well?
It's not a SkinWeight, but a SkinWidth option. And no, the skin already has a such option (SkinWidth=(#BgWidth#*#Scale#)), if you check the code (including the above one).
You do not have the required permissions to view the files attached to this post.
User avatar
Pul53dr1v3r
Posts: 231
Joined: July 30th, 2014, 10:30 am

Re: background image scaling

Pul53dr1v3r » April 8th, 2019, 8:08 pm

balala wrote:
April 8th, 2019, 7:32 pm
I doubt, because I don't have such problems. Everything is working well, with any scale. For example here you have what I got for Scale=3:
Test.png
So, here is the complete code. Please try this out too:

Code: Select all

;READ THE [Variables] SECTION BELOW FOR SETUP INFORMATION
[Metadata]
Author=Pul53dr1v3r

[Rainmeter]
Update=1000
Background=#@#Background.png
SkinHeight=(100+90*(#Scale#-1)+40*#Scale#*Clamp(#SkinState#,0,1))
SkinWidth=(#BgWidth#*#Scale#)
AccurateText=1
BackgroundMode=3
BackgroundMargins=0,34,0,13

[Variables]
;CPU Name or Title for widget/gadget
CPUName=cpu-ram
FontFamily=Trebuchet MS
textSize=8
colorBar=255,140,0,200
colorText=255,255,255,205
EmptyBarColor=255,255,255,25
barHeight=1
barWidth=90
SkinState=0
RamHistState=0
CpuHistState=1
TempHistState=0
@Include=#@#\HWiNFO.inc
BgHeight=150
BgWidth=210
Scale=1

;=========================
;CPU AND RAM INFO
;=========================

[styleTitle]
StringAlign=CENTER
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#FontFamily#
FontSize=10
AntiAlias=1
;ClipString=1

[styleCenterText]
StringAlign=Center
StringCase=NONE
StringStyle=BOLD
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#FontFamily#
FontSize=#textSize#
AntiAlias=1
;ClipString=1

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#FontFamily#
FontSize=8
AntiAlias=1

[styleRightText]
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#FontFamily#
FontSize=8
AntiAlias=1

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=104
Y=12
H=100
Text="#CPUNAME#"
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;[""""""""""""""""""""""""""""""[[CPU_Temperature]]""""""""""""""""""""""""""""""]

[CPUTotalTemp]
Meter=STRING
MeasureName=MCPUTemp
MeterStyle=styleCenterText
Text="%1°C"
FontColor=[MCPUTempCalc]
x=104
Y=38
W=1
H=1
DynamicVariables=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[MCPUTemp]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#HWiNFO-MOBO-SensorId#
HWiNFOSensorInstance=#HWiNFO-MOBO-SensorInstance#
HWiNFOEntryId=#HWiNFO-MOBO-CPU-Temp#
HWiNFOType=CurrentValue
HWiNFOLogHandler=0
MinValue=0
MaxValue=100

[MCPUTempCalc]
Measure=Calc
Formula=MCPUTemp< 25 ? -1 : (MCPUTemp < 40 ? -2 : (MCPUTemp < 50 ? -3 : (MCPUTemp < 60 ? -4 : -5)))
Substitute="-1":"255,255,255","-2":"255,255,102","-3":"255,153,51","-4":"255,0,0","-5":"204,0,0"

;[""""""""""""""""""""""""""""""[[CPU_Meters]]""""""""""""""""""""""""""""""]

[TotalCPUUsageText]
Meter=STRING
MeterStyle=styleLeftText
Text="CPU:"
X=9
Y=40
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[CPUTotalBarGraphUsage]
Meter=BAR
MeasureName=MCLOADTOTAL
BarColor=[CPUBARWARNT]
SolidColor=#EmptyBarColor#
BarOrientation=HORIZONTAL
X=9
Y=52
W=190
H=2
DynamicVariables=1
Autoscale=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[TotalCPUUsagePercent]
Meter=String
MeasureName=CPUPERCENTCALC
MeterStyle=styleRightText
X=199
Y=38
Text="[%1%]"
NumofDecimals=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;CPU Usage Measures
[MCLOADTOTAL]
Measure=CPU
Processor=0

;CPU Usage percent measures
[CPUPERCENTCALC]
Measure=Calc
Formula=MCLOADTOTAL * 1

;CPU Usage Bar Warning
[CPUBARWARNT]
Measure=Calc
Formula=CPUPERCENTCALC> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

;[""""""""""""""""""""""""""""""[[CPU_Clock]]""""""""""""""""""""""""""""""]

[MCLOCK]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#HWiNFO-CPU0-SensorId#
HWiNFOSensorInstance=#HWiNFO-CPU0-SensorInstance#
HWiNFOEntryId=#HWiNFO-CPU0-Clock#
HWiNFOType=CurrentValue

[MeterMHz]
Meter=STRING
MeasureName=MCLOCK
MeterStyle=styleLeftText
FontColor=255,255,255,100
StringStyle=Normal
;FontSize=7
;FontFace=Arial
Text="Clock: %1 MHz"
X=9
Y=56
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;[""""""""""""""""""""""""""""""[[CPU_Fan]]""""""""""""""""""""""""""""""]

[CPUFanText]
Meter=STRING
MeasureName=CPUFAN0
MeterStyle=styleRightText
FontColor=255, 255, 255,100
StringStyle=Normal
;FontSize=7
;FontFace=Arial
Text="FAN: %1rpm"
X=199
Y=r
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[CPUFAN0]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#HWiNFO-MOBO-SensorId#
HWiNFOSensorInstance=#HWiNFO-MOBO-SensorInstance#
HWiNFOEntryId=#HWiNFO-MOBO-CPU-Fan#
HWiNFOType=CurrentValue
HWiNFOLogHandler=0
MinValue=0
MaxValue=5000

;[""""""""""""""""""""""""""""""[[RAM]]""""""""""""""""""""""""""""""]

[MeasureRAMTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=600

[MeasureRAMUsed]
Measure=PhysicalMemory

[MeasureRAMFree]
Measure=PhysicalMemory
InvertMeasure=1

[RAMUsageLabel]
Meter=String
MeterStyle=styleLeftText
Text="RAM:"
x=9
y=18r
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[RAMUsage]
Meter=BAR
MeasureName=MeasureRAMUsed
X=9
Y=0R
W=190
H=1
BarColor=[RAMWarn]
SolidColor=#EmptyBarColor#
BarOrientation=HORIZONTAL
DynamicVariables=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[RAMUsedGB]
Meter=STRING
MeterStyle=styleCenterText
MeasureName=MeasureRAMTotal
MeasureName2=MeasureRAMUsed
MeasureName3=MeasureRAMFree
;FontColor=255, 255, 255, 100
NumofDecimals=1
X=104
Y=-12r
Text="%2B/%1B"
Autoscale=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[RAMUsagePercent]
Meter=STRING
MeasureName=MeasureRAMUsed
MeterStyle=styleRightText
X=199
Y=-2r
;H=18
Text="[%1%]"
NumofDecimals=0
Percentual=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;[""""""""""""""""""""""""""""""[[RAM_Warning_Levels]]""""""""""""""""""""""""""""""]

[measureRAMGBCalc]
Measure=Calc
Formula=MeasureRAMUsed * 100 / MeasureRAMTotal

[measureRAMGBCalc2]
Measure=Calc
Formula=measureRAMGBCalc
MinValue=0
MaxValue=100
Percentual=1

[RAMWarn]
Measure=Calc
Formula=measureRAMGBCalc2> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

;[""""""""""""""""""""""""""""""[[Histograms]]""""""""""""""""""""""""""""""]

[CpuHistogram]
Meter=Histogram
MeasureName=MCLOADTOTAL
GraphStart=Left
X=10
Y=-40
W=186
H=25
Autoscale=1
Antialias=1
PrimaryColor=176,196,222,150
;SolidColor=255,255,255,15
Group=Graphs
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[RamHistogram]
Meter=Histogram
MeasureName=MeasureRAMUsed
GraphStart=Left
X=10
Y=-40
W=186
H=25
Autoscale=1
Antialias=1
PrimaryColor=176,196,222,150
;SolidColor=255,255,255,15
Group=Graphs
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[TempHistogram]
Meter=Histogram
MeasureName=MCPUTemp
GraphStart=Left
X=10
Y=-40
W=186
H=25
Autoscale=1
Antialias=1
PrimaryColor=176,196,222,150
;SolidColor=255,255,255,15
Group=Graphs
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;(""""""""""((UniqueHistBg))"""""""""")

[HistogramBackground]
Meter=Image
X=10
Y=-40
W=186
H=25
;PrimaryColor=176,196,222,150
SolidColor=255,255,255,15
Group=Graphs
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

;(""""""""""((TEMP))"""""""""")

[HideTempHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=74
Y=-40
H=7
FontColor=255,140,0,200
Text=TMP
LeftMouseUpAction=[!SetVariable TempHistState "0"][!WriteKeyValue Variables TempHistState "0"][!UpdateMeasure "MeasureTempHistState"]
Group=TButtons
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[ShowTempHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=r
Y=-40
H=7
FontColor=255,255,255,50
Text=TMP
LeftMouseUpAction=[!SetVariable TempHistState "1"][!WriteKeyValue Variables TempHistState "1"][!SetVariable CpuHistState "0"][!WriteKeyValue Variables CpuHistState "0"][!SetVariable RamHistState "0"][!WriteKeyValue Variables RamHistState "0"][!UpdateMeasure "MeasureTempHistState"][!UpdateMeasure "MeasureCpuHistState"][!UpdateMeasure "MeasureRamHistState"]
Hidden=1
Group=TButtons
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[MeasureTempHistState]
Measure=Calc
Formula=#TempHistState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "TempHistogram"][!ShowMeter "ShowTempHistogram"][!HideMeter "HideTempHistogram"][!Update]
IfFalseAction=[!ShowMeter "TempHistogram"][!HideMeter "ShowTempHistogram"][!ShowMeter "HideTempHistogram"][!Update]
DynamicVariables=1
Disabled=1

;(""""""""""((CPU))"""""""""")

[HideCpuHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=104
Y=-40
H=7
FontColor=255,140,0,200
Text=CPU
LeftMouseUpAction=[!SetVariable CpuHistState "0"][!WriteKeyValue Variables CpuHistState "0"][!UpdateMeasure "MeasureCpuHistState"]
Group=TButtons
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[ShowCpuHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=r
Y=-40
H=7
FontColor=255,255,255,50
Text=CPU
LeftMouseUpAction=[!SetVariable CpuHistState "1"][!WriteKeyValue Variables CpuHistState "1"][!SetVariable TempHistState "0"][!WriteKeyValue Variables TempHistState "0"][!SetVariable RamHistState "0"][!WriteKeyValue Variables RamHistState "0"][!UpdateMeasure "MeasureCpuHistState"][!UpdateMeasure "MeasureTempHistState"][!UpdateMeasure "MeasureRamHistState"]
Hidden=1
Group=TButtons
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[MeasureCpuHistState]
Measure=Calc
Formula=#CpuHistState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "CpuHistogram"][!ShowMeter "ShowCpuHistogram"][!HideMeter "HideCpuHistogram"][!Update]
IfFalseAction=[!ShowMeter "CpuHistogram"][!HideMeter "ShowCpuHistogram"][!ShowMeter "HideCpuHistogram"][!Update]
DynamicVariables=1
Disabled=1

;(""""""""""((RAM))"""""""""")

[HideRamHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=134
;Y=([MeterMHz:Y]+60)
Y=-40
H=7
FontColor=255,140,0,200
Text=RAM
LeftMouseUpAction=[!SetVariable RamHistState "0"][!WriteKeyValue Variables RamHistState "0"][!UpdateMeasure "MeasureRamHistState"]
Group=TButtons
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[ShowRamHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=r
Y=-40
H=7
FontColor=255,255,255,50
Text=RAM
LeftMouseUpAction=[!SetVariable RamHistState "1"][!WriteKeyValue Variables RamHistState "1"][!SetVariable TempHistState "0"][!WriteKeyValue Variables TempHistState "0"][!SetVariable CpuHistState "0"][!WriteKeyValue Variables CpuHistState "0"][!UpdateMeasure "MeasureRamHistState"][!UpdateMeasure "MeasureTempHistState"][!UpdateMeasure "MeasureCpuHistState"]
Hidden=1
Group=TButtons
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[MeasureRamHistState]
Measure=Calc
Formula=#RamHistState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "RamHistogram"][!ShowMeter "ShowRamHistogram"][!HideMeter "HideRamHistogram"][!Update]
IfFalseAction=[!ShowMeter "RamHistogram"][!HideMeter "ShowRamHistogram"][!ShowMeter "HideRamHistogram"][!Update]
DynamicVariables=1
Disabled=1

;[""""""""""""""""""""""""""""""[[Collapse-Expand]]""""""""""""""""""""""""""""""]

[meterHideGraphs]
Meter=Image
ImageName=#@#Images\left.png
X=185
Y=15
W=10
H=10
ImageTint=255,255,255,150
;LeftMouseUpAction=[!SetVariable SkinState "0"][!WriteKeyValue Variables SkinState "0"][!UpdateMeasure "MeasureSkinState"]
TooltipText=Hide graph
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[meterHideGraphsClickableRegion]
Meter=Image
Solidcolor=0,0,0,0
X=([meterHideGraphs:X] * #Scale#)
Y=([meterHideGraphs:Y] * #Scale#)
H=([meterHideGraphs:H] * #Scale#)
W=([meterHideGraphs:W] * #Scale#)
LeftMouseUpAction=[!SetVariable SkinState "0"][!WriteKeyValue Variables SkinState "0"][!Refresh]
UpdateDivider=1
DynamicVariables=1

[meterShowGraphs]
Meter=Image
ImageName=#@#Images\right.png
X=185
Y=15
H=10
W=10
ImageTint=255,255,255,150
;LeftMouseUpAction=[!SetVariable SkinState "1"][!WriteKeyValue Variables SkinState "1"][!UpdateMeasure "MeasureSkinState"]
TooltipText=Show graph
Hidden=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[meterShowGraphsClckableRegion]
Meter=Image
Solidcolor=0,0,0,0
X=([meterShowGraphs:X] * #Scale#)
Y=([meterShowGraphs:Y] * #Scale#)
H=([meterShowGraphs:H] * #Scale#)
W=([meterShowGraphs:W] * #Scale#)
LeftMouseUpAction=[!SetVariable SkinState "1"][!WriteKeyValue Variables SkinState "1"][!Refresh]
UpdateDivider=1
Hidden=1
DynamicVariables=1

[MeasureSkinState]
Measure=Calc
Formula=#SkinState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!DisableMeasure "MeasureTempHistState"][!DisableMeasure "MeasureCpuHistState"][!DisableMeasure "MeasureRamHistState"][!HideMeterGroup "Graphs"][!HideMeterGroup "TButtons"][!ShowMeter "meterShowGraphs"][!ShowMeter "meterShowGraphsClckableRegion"][!HideMeter "meterHideGraphs"][!HideMeter "meterHideGraphsClickableRegion"][!SetOptionGroup "Graphs" "Y" "0"][!SetOptionGroup "TButtons" "Y" "0"][!HideMeter "HistogramBackground"][!Update]
IfFalseAction=[!EnableMeasure "MeasureTempHistState"][!EnableMeasure "MeasureCpuHistState"][!EnableMeasure "MeasureRamHistState"][!HideMeter "meterShowGraphs"][!HideMeter "meterShowGraphsClckableRegion"][!ShowMeter "meterHideGraphs"][!ShowMeter "meterHideGraphsClickableRegion"][!SetOption TempHistogram Y "([MeterMHz:Y]+35)"][!SetOption CpuHistogram Y "([MeterMHz:Y]+35)"][!SetOption RamHistogram Y "([MeterMHz:Y]+35)"][!SetOption HideTempHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!SetOption ShowTempHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!SetOption HideCpuHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!SetOption ShowCpuHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!SetOption HideRamHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!SetOption ShowRamHistogram Y "([MeterMHz:Y]+60-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))"][!ShowMeter "HistogramBackground"][!SetOption HistogramBackground Y "([MeterMHz:Y]+35)"][!Update]
DynamicVariables=1
It's not a SkinWeight, but a SkinWidth option. And no, the skin already has a such option (SkinWidth=(#BgWidth#*#Scale#)), if you check the code (including the above one).
I lost my head... Yes, SkinWidth* and it was the line missing, sorry. Don't know how, but i ommited it and tha's why i asked you about it. It's ok for now.

One more question. Is it possible to move only the darker part of the bg at the top according to the content scale? The title should be in the darer region by default, but i belive that if it's possible, we should do sth with margins, sholdn't we?
User avatar
balala
Rainmeter Sage
Posts: 8828
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: background image scaling

balala » April 8th, 2019, 8:15 pm

Pul53dr1v3r wrote:
April 8th, 2019, 8:08 pm
Is it possible to move only the darker part of the bg at the top according to the content scale? The title should be in the darer region by default, but i belive that if it's possible, we should do sth with margins, sholdn't we?
I'd say it's not.
However I'd suggest another thing instead. Maybe you should not use a background image (as you do now), but use a Shape meter instead. A such meter can be drawn to look like this background image, but being created by editable code, it is much more simple to alter it in a way you need. Do you agree?
User avatar
Pul53dr1v3r
Posts: 231
Joined: July 30th, 2014, 10:30 am

Re: background image scaling

Pul53dr1v3r » April 8th, 2019, 8:25 pm

balala wrote:
April 8th, 2019, 8:15 pm

I'd say it's not.
However I'd suggest another thing instead. Maybe you should not use a background image (as you do now), but use a Shape meter instead. A such meter can be drawn to look like this background image, but being created by editable code, it is much more simple to alter it in a way you need. Do you agree?
Yes, i just have to take a look at shape meters to get some knowledge since i have never had any need to use it, so far.
If it would look the same, hwo care is it an image or not. Good idea.
Last edited by Pul53dr1v3r on April 8th, 2019, 8:37 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 8828
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: background image scaling

balala » April 8th, 2019, 8:32 pm

Pul53dr1v3r wrote:
April 8th, 2019, 8:25 pm
Yes, i have just to take a look at shape meters to get some knowledge since i haven't ever had any need to use it, so far.
If it would look the same, hwo care is it an image or not. Good idea.
I recommend to take a look. Shape is an extremely powerful and versatile meter, which can be used in many circumstances in everyday work.
If you can't figure out how to properly create it (at first time it's not a simple type of meter), please let me know to assist you (if you want).
User avatar
Pul53dr1v3r
Posts: 231
Joined: July 30th, 2014, 10:30 am

Re: background image scaling

Pul53dr1v3r » April 8th, 2019, 8:43 pm

balala wrote:
April 8th, 2019, 8:32 pm
I recommend to take a look. Shape is an extremely powerful and versatile meter, which can be used in many circumstances in everyday work.
If you can't figure out how to properly create it (at first time it's not a simple type of meter), please let me know to assist you (if you want).
Thank you! I'll try to do it tmorrow and we'll see... Good night for now mate...
User avatar
balala
Rainmeter Sage
Posts: 8828
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: background image scaling

balala » April 8th, 2019, 9:18 pm

Pul53dr1v3r wrote:
April 8th, 2019, 8:43 pm
I'll try to do it tmorrow and we'll see...
Ok, let me know if you succeeded. And also let me know if you didn't.
User avatar
Pul53dr1v3r
Posts: 231
Joined: July 30th, 2014, 10:30 am

Re: background image scaling

Pul53dr1v3r » April 9th, 2019, 8:23 pm

balala wrote:
April 8th, 2019, 9:18 pm
Ok, let me know if you succeeded. And also let me know if you didn't.
50/50. I succeed in getting the shape, but not in getting the bg scales according to the content at the bottom side when the graphs are on at any scales.
I'm also not quite sure is it the best way to get such a shape but everithyng else is working properly.
You do not have the required permissions to view the files attached to this post.