It is currently March 28th, 2024, 9:43 pm

Quick question

General topics related to Rainmeter.
Greyrat
Posts: 28
Joined: July 8th, 2016, 10:28 am

Quick question

Post by Greyrat »

How does the quote plugin work?For example,I have a folder of images i want to use as backgrounds.How does it change and at what intervals?
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Quick question

Post by fonpaolo »

It's entirely up to you...
Update in the Rainmeter section is the base, so, if you use 1000 as update you'll have an update every second. (Do you really want to update an image so often?)

UpdateDivider in the Quote plugin Measure and you'll have the measure updating less often.

Use a Button to update only when you click on it using LeftMouseUpAction.

And so on...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Quick question

Post by jsmorley »

Well, if you look at the example in the docs:

https://docs.rainmeter.net/manual/plugins/quote/

Code: Select all

[Rainmeter]
Update=1000

[MeasureRandomImage]
Measure=Plugin
Plugin=QuotePlugin
PathName=%HOMEDRIVE%%HOMEPATH%\Pictures\
Subfolders=1
FileFilter=*.jpg;*.png;*.gif
UpdateDivider=30

[MeterRandomImage]
Meter=Image
MeasureName=MeasureRandomImage
X=0
Y=0
W=200
PreserveAspectRatio=1
What that is doing is picking a random file from a folder, and all its sub-folders, that you define. It will look for .jpg, .png or .gif image files in that folder structure.

Then it displays that image in an Image meter, with a set width of 200 pixels, and the height automatically set to preserve the aspect ratio.

You control how often it changes the image by changing the UpdateDivider option in the [MeasureRandomImage] measure, setting the value to the number of seconds between each change you want. In the example, it is 30 seconds.

The reason this works out to a number of "seconds", is that UpdateDivider is multiplied by the overall Update setting in the [Rainmeter] section, which by default is 1000 milliseconds or one second. So the skin will update once a second, and the measure will update every 30 times the skin updates.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Quick question

Post by jsmorley »

And as fonpaolo says, you can even make this be "on demand" rather than "timed":

Code: Select all

[Rainmeter]
Update=1000

[MeasureRandomImage]
Measure=Plugin
Plugin=QuotePlugin
PathName=%HOMEDRIVE%%HOMEPATH%\Pictures\
Subfolders=1
FileFilter=*.jpg;*.png;*.gif
UpdateDivider=-1

[MeterRandomImage]
Meter=Image
MeasureName=MeasureRandomImage
X=0
Y=0
W=200
PreserveAspectRatio=1
LeftMouseUpAction=[!UpdateMeasure MeasureRandomImage][!UpdateMeter MeterRandomImage][!Redraw]
That will only update the measure [MeasureRandomImage] once, when the skin is first loaded or refreshed. Then when you left-click on the Image meter, it will force an update of the measure, update the meter to have the latest value, and redraw the skin.

Combine the two approaches to have it be both timed and on demand...