My only (last) concern about all this scaling (and not only, trying to avoid the use of Refresh as much as I can), is DynamicVariables.
I'm experiencing a little increase in the use of system resources (mostly on CPU).
Ok, this increase is from below 1% to 1-2%, but the only change is the adding of DynamicVariables to some meters, in some cases, a lot of them.
I can also think that all this scaling could use more memory than the same skin, but with the "exact" dimensions.
It is currently April 27th, 2024, 7:06 am
[Suggestion] Increase/decrease size of skins through Rainmeter
-
- Moderator
- Posts: 1387
- Joined: April 11th, 2013, 8:08 pm
- Location: Italy
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: [Suggestion] Increase/decrease size of skins through Rainmeter
A couple of things to keep in mind with Image meters.
1) When an image is loaded, it is "cached" by Rainmeter and is not reloaded from disk on each update of the meter. However, if you have DynamicVariables=1 on the meter, then the image is reloaded on each update. While Windows itself does a pretty good job of caching files that have not changed, this does use a bit more CPU in Rainmeter.
2) If you have W and / or H on an Image meter, then the image is sized to the specified size on each skin "redraw". This is not during the meter "update", which can be managed with UpdateDivider, but on the skin redraw, which will happen on each skin update, period. This resizing can really use a lot of CPU, more so the more the "difference" is between the real size and the resized size. This has nothing to do with DynamicVariables, and will happen with or without that. This also always happens even if the W and H defined on the meter ARE the actual image size.
So the upshot of it is that the best performance can be had by using images that are already the size you want, and not using any W or H at all on the meter, and only using DynamicVariables=1 on Image meters when the functionality requires it.
1) When an image is loaded, it is "cached" by Rainmeter and is not reloaded from disk on each update of the meter. However, if you have DynamicVariables=1 on the meter, then the image is reloaded on each update. While Windows itself does a pretty good job of caching files that have not changed, this does use a bit more CPU in Rainmeter.
2) If you have W and / or H on an Image meter, then the image is sized to the specified size on each skin "redraw". This is not during the meter "update", which can be managed with UpdateDivider, but on the skin redraw, which will happen on each skin update, period. This resizing can really use a lot of CPU, more so the more the "difference" is between the real size and the resized size. This has nothing to do with DynamicVariables, and will happen with or without that. This also always happens even if the W and H defined on the meter ARE the actual image size.
So the upshot of it is that the best performance can be had by using images that are already the size you want, and not using any W or H at all on the meter, and only using DynamicVariables=1 on Image meters when the functionality requires it.
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: [Suggestion] Increase/decrease size of skins through Rainmeter
Interesting discussion! TransformationMatrix is the best alternative we have to scale skins.
I have done a lot of scaling to my skins due to the increased resolution of new systems and would like to add the TransformationMatrix formula I have been using that works well for most Rainmeter meters (Shape is a sepaerate beast!).
I would point out that the formula SilverAzide posted does not take into consideration the relative position of individual meters in relation to other meters in the skin.
SilverAzide: TransformationMatrix=#Scaler#;0;0;#Scaler#;#Scaler#;#Scaler#
The formula I use, was presented by member Xanci, and will keep meters relatively positioned correctly.
Xanci: TransformationMatrix=#Scaler#;0;0;#Scaler#;((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
This formula will correct for relative positions as it scales. Thanks Xanci!
Aside from the limitations already mentioned, image distortion & especially erratic mouse detection, the use of TransformationMatrix for W, H, and position along with scaling factors of X & Y values, make the process of scaling skins fairly straightforward, but not a 1-button solution...
I leave that up to younger minds!
I have done a lot of scaling to my skins due to the increased resolution of new systems and would like to add the TransformationMatrix formula I have been using that works well for most Rainmeter meters (Shape is a sepaerate beast!).
I would point out that the formula SilverAzide posted does not take into consideration the relative position of individual meters in relation to other meters in the skin.
SilverAzide: TransformationMatrix=#Scaler#;0;0;#Scaler#;#Scaler#;#Scaler#
The formula I use, was presented by member Xanci, and will keep meters relatively positioned correctly.
Xanci: TransformationMatrix=#Scaler#;0;0;#Scaler#;((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
This formula will correct for relative positions as it scales. Thanks Xanci!
Aside from the limitations already mentioned, image distortion & especially erratic mouse detection, the use of TransformationMatrix for W, H, and position along with scaling factors of X & Y values, make the process of scaling skins fairly straightforward, but not a 1-button solution...
I leave that up to younger minds!
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Moderator
- Posts: 1387
- Joined: April 11th, 2013, 8:08 pm
- Location: Italy
Re: [Suggestion] Increase/decrease size of skins through Rainmeter
As you've noticed, eclectic-tech, TrasformationMatrix has to be used carefully, I ended up with this:
Where Timesize is the scaling factor (obviously), 255 and 157 are, respectively, X and Y position of the original image.
Code: Select all
TransformationMatrix=#TimeSize#; 0; 0; #TimeSize#; (Round(255*#TimeSize#)); (Round(157*#TimeSize#))
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: [Suggestion] Increase/decrease size of skins through Rainmeter
Why are you changing the formula?fonpaolo wrote:As you've noticed, eclectic-tech, TrasformationMatrix has to be used carefully, I ended up with this:Where Timesize is the scaling factor (obviously), 255 and 157 are, respectively, X and Y position of the original image.Code: Select all
TransformationMatrix=#TimeSize#; 0; 0; #TimeSize#; (Round(255*#TimeSize#)); (Round(157*#TimeSize#))
Simply create the original meter at scaler=1 (TimeSize), then add the transformationmatrix formula as it is written.
Code: Select all
[Clock]
Meter=String
X=(255*#Scaler#)
Y=(157*#Scaler#)
...
TransformationMatrix=#Scaler#;0;0#Scaler#;((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Moderator
- Posts: 1387
- Joined: April 11th, 2013, 8:08 pm
- Location: Italy
Re: [Suggestion] Increase/decrease size of skins through Rainmeter
That's exactly what I was thinking.jsmorley wrote:...
So the upshot of it is that the best performance can be had by using images that are already the size you want, and not using any W or H at all on the meter, and only using DynamicVariables=1 on Image meters when the functionality requires it.
Often, if not always, I use UpdateDivider=-1 on everything, however, to add some dynamic changes and avoid to refresh the skin(s), there's only DynamicVariables, as the name itself says, if you want to dynamically change (one or all) the variable(s) in a skin.
Probably, having at least 30 skins loaded, using in various meters with both DynamicVariables, and UpdateDivider=-1 isn't a problem, but when using DynamicVariables on meters which also are regularly updated with some measure(s), seems to increase the system resource usage.
-
- Moderator
- Posts: 1387
- Joined: April 11th, 2013, 8:08 pm
- Location: Italy
Re: [Suggestion] Increase/decrease size of skins through Rainmeter
Because I tried, only mine is working...eclectic-tech wrote:Why are you changing the formula?
Simply create the original meter at scaler=1 (TimeSize), then add the transformationmatrix formula as it is written.THe X & Y values use the Scaler variable for position and the Transformationmatrix re-sizes and corrects that "scaled" position.Code: Select all
[Clock] Meter=String X=(255*#Scaler#) Y=(157*#Scaler#) ... TransformationMatrix=#Scaler#;0;0#Scaler#;((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
...oh and it's not text, it's Rotator.
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: [Suggestion] Increase/decrease size of skins through Rainmeter
Hmm? Look at this rotator example...
You will need my image (save it in '@Resources\Images' for the code below) And here is a scaled rotator skin code: This is only 1 meter in this skin, so the relative position is not shown, but to see the difference, you could try my Odometer clock skin and change the transformationmatrix formula between SilverAzide's suggestion and Xanci and see how the relative positions are maintain (or not maintained)...
You will need my image (save it in '@Resources\Images' for the code below) And here is a scaled rotator skin code:
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#
You do not have the required permissions to view the files attached to this post.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Moderator
- Posts: 1387
- Joined: April 11th, 2013, 8:08 pm
- Location: Italy
Re: [Suggestion] Increase/decrease size of skins through Rainmeter
Yes, I see, however in your Rotator W and H are equal to 0...
If I add your formula in my skin, now, both are working, if I remove W and H, none...
Not enough time to try to understand the reasons behind, probably it's a matter of positioning, because if I add W and H to your skin, it's not centered.
If I add your formula in my skin, now, both are working, if I remove W and H, none...
Not enough time to try to understand the reasons behind, probably it's a matter of positioning, because if I add W and H to your skin, it's not centered.
-
- Rainmeter Sage
- Posts: 2611
- Joined: March 23rd, 2015, 5:26 pm
Re: [Suggestion] Increase/decrease size of skins through Rainmeter
...And fonpaolo takes the red pill. Welcome to the TransformationMatrix, fonpaolo!fonpaolo wrote:Oh, as a side node, TransformationMatrix did the trick!
So, balala, be aware: I'm starting to love TransformationMatrix, I hope you're not too jealous.
Sweet! Thanks for the tip eclectic-tech, I'm gonna try this!eclectic-tech wrote:I would point out that the formula SilverAzide posted does not take into consideration the relative position of individual meters in relation to other meters in the skin.
SilverAzide: TransformationMatrix=#Scaler#;0;0;#Scaler#;#Scaler#;#Scaler#
The formula I use, was presented by member Xanci, and will keep meters relatively positioned correctly.
Xanci: TransformationMatrix=#Scaler#;0;0;#Scaler#;((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
This formula will correct for relative positions as it scales.