Code: Select all
[Rainmeter]
Update=50
Dynamicwindowsize=1
LeftMouseDoubleClickAction=[!WriteKeyValue Variables Scaler 1][!Refresh]
[Variables]
Scaler=1
ImageW=128
ImageH=64
MaxDiameter=(SQRT(#ImageW# ** 2 + #ImageH# ** 2))
ImageSW=(#ImageW#*#Scaler#)
ImageSH=(#ImageH#*#Scaler#)
; The rectangle image size is 128x64 pixels
; To use with a different image, change the ImageW & ImageH 'numbers' to match your image size
[mScalerUp]
Measure=Calc
Formula=(#Scaler#+0.01>2.0)? 2.0:(#Scaler#+0.01)
DynamicVariables=1
UpdateDivider=-1
; Measures the next largest size; limits it to 2x
[mScalerDn]
Measure=Calc
Formula=(#Scaler#-0.01<0.1)? 0.1:(#Scaler#-0.01)
DynamicVariables=1
UpdateDivider=-1
; Measures the next smallest size; limits it to .1x
[MeasureRotate]
Measure=Calc
Formula=(MeasureRotate % 360) + 1
MaxValue=360
; Controls rotation
[MeterBG]
Meter=Image
SolidColor=0,0,0,128
W=(#MaxDiameter#*#Scaler#)
H=(#MaxDiameter#*#Scaler#)
MouseScrollUpAction=[!WriteKeyValue Variables Scaler ([mScalerUp])][!Refresh #CurrentConfig#]
MouseScrollDownAction=[!WriteKeyValue Variables Scaler ([mScalerDn])][!Refresh #CurrentConfig#]
[MeterRotate]
Meter=Rotator
MeasureName=MeasureRotate
ImageName=#@#images\rectangle.png
X=([MeterBG:W]/2)
Y=([MeterBG:H]/2)
OffsetX=(#ImageW#/2)
OffsetY=(#ImageH#/2)
TransformationMatrix=(#Scaler#);0;0;(#Scaler#);((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
DynamicVariables=1
[MeterScaleText]
Meter=String
X=([MeterBG:W]/2)
Y=([MeterBG:W]/2)
FontColor=255,255,255
StringAlign=CenterCenter
StringEffect=Shadow
Text=Scale: #Scaler#