It is currently October 15th, 2019, 7:51 pm

background image scaling

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

Re: background image scaling

balala » April 5th, 2019, 6:08 pm

Pul53dr1v3r wrote:
April 5th, 2019, 4:41 pm
I've no idea if it is even possible...
I doubt it wouldn't be:

Code: Select all

;READ THE [Variables] SECTION BELOW FOR SETUP INFORMATION
[Rainmeter]
Author=Pul53dr1v3r
AppVersion=test
Update=1000
Background=#@#Background.png
SkinHeight=((#BgHeight#-12*#Scale#*(1-Clamp((#RamHistState#+#CpuHistState#),0,1)))*#Scale#)
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=1
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"][!UpdateMeasure "MeasureSkinState"]
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"][!UpdateMeasure "MeasureSkinState"]
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
See that I've rewritten a lot of thing there, for example the SkinHeight option ([Rainmeter] section) and the formulas calculating the Y values of more meters, in the IfFalseAction option of the [MeasureSkinState] measure (I also removed a lot of quotation marks in this last option).
Two other comments, if you don't mind:
  • Both the Author and the AppVersion options of the [Rainmeter] section are deprecated. Move the Author to [Metadata] and remove completely the AppVersion.
  • The quotations are not needed around the values of options. For example they are not needed around the CPU value of Text option of the [HideCpuHistogram] meter (same for the other values of all other Text options). So, I replaced the Text="CPU" with Text=CPU. Details here.
User avatar
Pul53dr1v3r
Posts: 231
Joined: July 30th, 2014, 10:30 am

Re: background image scaling

Pul53dr1v3r » April 5th, 2019, 7:11 pm

balala wrote:
April 5th, 2019, 6:08 pm
Good job as to fitting the content to the bg horizontally, but seems there is a more complicated situation to fix the vertical issue that exists. As you can see on the gif (left is this scaled skin to 2, left is origianl unscaled), the empty skin space has been stuck when we turn off the graphs. It wont hide. But even when the graphs are on, there is more empty space at the bottom skin part, than it should be (pls take a look below the graph buttons: TMP, CPU, RAM).

Another issue (maybe less important) the top-the title part of the bg. The darker part is where the title goes, in the middle of it vertically and horizontally, but here is stuck since we set BackgroundMargins.
It would be nice if we could make sth like this BackgroundMargins=(0 * #Scale#),(34 * #Scale#) ,(0 * #Scale#),(13 * #Scale#). Probably it would stretch the darker bg part at the top.

Thx for the note #2 about "" and deprecated options. :thumbup:
Edit: i'm "deprecated" as well.

gif
User avatar
balala
Rainmeter Sage
Posts: 8823
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: background image scaling

balala » April 5th, 2019, 7:53 pm

Pul53dr1v3r wrote:
April 5th, 2019, 7:11 pm
Edit: i'm "deprecated" as well.
No, you're not! Forget this stupid thing. Probably no users on this forum are.
Pul53dr1v3r wrote:
April 5th, 2019, 7:11 pm
(left is this scaled skin to 2, left is original unscaled)
(left is this scaled skin to 2, right is origianl unscaled)
Pul53dr1v3r wrote:
April 5th, 2019, 7:11 pm
Good job as to fitting the content to the bg horizontally, but seems there is a more complicated situation to fix the vertical issue that exists. As you can see on the gif (left is this scaled skin to 2, left is origianl unscaled), the empty skin space has been stuck when we turn off the graphs. It wont hide. But even when the graphs are on, there is more empty space at the bottom skin part, than it should be (pls take a look below the graph buttons: TMP, CPU, RAM).
Again: unfortunately probably you can't get this to work properly dynamically, because when clicking, we should have to set a new value for SkinHeight, within the [Rainmeter] section (changing the RamHistState and CpuHistState variables). But this section, unlike meters and measures, doesn't support dynamic updates (nor dynamically set variables - with the !SetVariable bang -, nor dynamically set options - with !SetOption).
Probably due to this, the skin will more or less (yep, maybe there still are some details which have to be polished) work properly when you rewrite the variables manually and refresh the skin, but doesn't when you dynamically set the variables.
Sorry, no solutions, I think. Unless every time you're changing those variables (clicking the button), you're rewriting them into the [Variables] section, then refresh the skin. I usually am against refreshing the skins, but this time I think this is the only possible solution. Not talking that probably the users won't hide / show the histograms too frequently. Usually such settings are made once, when the skin is first time used (probably much rarely later). What do you think, is this somehow a good approach?
Pul53dr1v3r wrote:
April 5th, 2019, 7:11 pm
Another issue (maybe less important) the top-the title part of the bg. The darker part is where the title goes, in the middle of it vertically and horizontally, but here is stuck since we set BackgroundMargins.
It would be nice if we could make sth like this BackgroundMargins=(0 * #Scale#),(34 * #Scale#) ,(0 * #Scale#),(13 * #Scale#). Probably it would stretch the darker bg part at the top.
A such BackgroundMargins can be used, but it's useless, because the values used into a such option are related to the unscaled image, so if you're increasing the values, you don't get anything good. Probably no good solutions here.
User avatar
Pul53dr1v3r
Posts: 231
Joined: July 30th, 2014, 10:30 am

Re: background image scaling

Pul53dr1v3r » April 5th, 2019, 8:38 pm

balala wrote:
April 5th, 2019, 7:53 pm
Sorry for the error, yes right. :oops:
If you say it cannot be made work in the proper way as the unscaled skin, what to do than to give up. At some screen resolution the skins looks smaller, at the others bigger so it would be nice if we have the option to customize it. Even though, Win 10 has the scale option it's not so good to use. If you find a good solution in the meanwhile, i'd be honoured to integrate it into the skins. If not, the life goes on.

You've given your best shot, as always so the least word i can utter is multumesc frate!
User avatar
balala
Rainmeter Sage
Posts: 8823
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: background image scaling

balala » April 5th, 2019, 8:47 pm

Pul53dr1v3r wrote:
April 5th, 2019, 8:38 pm
If you say it cannot be made work in the proper way as the unscaled skin, what to do than to give up. At some screen resolution the skins looks smaller, at the others bigger so it would be nice if we have the option to customize it. Even though, Win 10 has the scale option it's not so good to use. If you find a good solution in the meanwhile, i'd be honoured to integrate it into the skins. If not, the life goes on.
No, probably you don't have to give it up. As I said:
balala wrote:
April 5th, 2019, 7:53 pm
Sorry, no solutions, I think. Unless every time you're changing those variables (clicking the button), you're rewriting them into the [Variables] section, then refresh the skin. I usually am against refreshing the skins, but this time I think this is the only possible solution. Not talking that probably the users won't hide / show the histograms too frequently. Usually such settings are made once, when the skin is first time used (probably much rarely later).
So, if you rewrite the variables every time you're clicking the button and refresh the skin, the problem could be managed, I think. Will take a look tomorrow, to figure out what can be done.
User avatar
Pul53dr1v3r
Posts: 231
Joined: July 30th, 2014, 10:30 am

Re: background image scaling

Pul53dr1v3r » April 6th, 2019, 6:48 pm

balala wrote:
April 5th, 2019, 8:47 pm
No, probably you don't have to give it up. As I said:

So, if you rewrite the variables every time you're clicking the button and refresh the skin, the problem could be managed, I think. Will take a look tomorrow, to figure out what can be done.
All right. I tried sth, but seems my Rainmeter knowledge is a bit rusty since i didn't have a single touch with it for a while...
User avatar
balala
Rainmeter Sage
Posts: 8823
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: background image scaling

balala » April 6th, 2019, 7:22 pm

Pul53dr1v3r wrote:
April 6th, 2019, 6:48 pm
All right. I tried sth, but seems my Rainmeter knowledge is a bit rusty since i didn't have a single touch with it for a while...
Replace the following options (leave unchanged the others):

Code: Select all

[Rainmeter]
...
SkinHeight=((#BgHeight#-12*#Scale#*(1-Clamp(#SkinState#,0,1)))*#Scale#)

[meterHideGraphsClickableRegion]
...
LeftMouseUpAction=[!SetVariable SkinState "0"][!WriteKeyValue Variables SkinState "0"][!UpdateMeasure "MeasureSkinState"][!Refresh]

[meterShowGraphsClckableRegion]
...
LeftMouseUpAction=[!SetVariable SkinState "1"][!WriteKeyValue Variables SkinState "1"][!UpdateMeasure "MeasureSkinState"][!Refresh]
Probably as I previously said, there will be needed some other polishes as well, but for first please test the code, to see if it more or less match your needs.
User avatar
Pul53dr1v3r
Posts: 231
Joined: July 30th, 2014, 10:30 am

Re: background image scaling

Pul53dr1v3r » April 6th, 2019, 7:55 pm

balala wrote:
April 6th, 2019, 7:22 pm
Replace the following options (leave unchanged the others):

Code: Select all

[Rainmeter]
...
SkinHeight=((#BgHeight#-12*#Scale#*(1-Clamp(#SkinState#,0,1)))*#Scale#)

[meterHideGraphsClickableRegion]
...
LeftMouseUpAction=[!SetVariable SkinState "0"][!WriteKeyValue Variables SkinState "0"][!UpdateMeasure "MeasureSkinState"][!Refresh]

[meterShowGraphsClckableRegion]
...
LeftMouseUpAction=[!SetVariable SkinState "1"][!WriteKeyValue Variables SkinState "1"][!UpdateMeasure "MeasureSkinState"][!Refresh]
Probably as I previously said, there will be needed some other polishes as well, but for first please test the code, to see if it more or less match your needs.
A bit better, but did you notice that the empty space at the bottom is smaller as we increase the Scale value? For instance, using Scale=5 crops half the skin when the graphs are off whilst when Scale=1 there is still significant empty space at the bottom unhidden.
User avatar
balala
Rainmeter Sage
Posts: 8823
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: background image scaling

balala » April 6th, 2019, 8:41 pm

Pul53dr1v3r wrote:
April 6th, 2019, 7:55 pm
A bit better, but did you notice that the empty space at the bottom is smaller as we increase the Scale value? For instance, using Scale=5 crops half the skin when the graphs are off whilst when Scale=1 there is still significant empty space at the bottom unhidden.
As I said
balala wrote:
April 6th, 2019, 7:22 pm
Probably ... there will be needed some other polishes
I'll left this for tomorrow, but I'll take a look.
User avatar
Pul53dr1v3r
Posts: 231
Joined: July 30th, 2014, 10:30 am

Re: background image scaling

Pul53dr1v3r » April 6th, 2019, 10:03 pm

balala wrote:
April 6th, 2019, 8:41 pm
As I said I'll left this for tomorrow, but I'll take a look.
You deserve a break. I'd suggest you not to touch this tomorrow, better from Monday on. Sunday should be used for sth else if you agree. It's more than enough that we have you (all the helpers here) 6/7 days in a week. See you soon mate.