It is currently July 27th, 2024, 7:57 am

Problem with random image generator

General topics related to Rainmeter.
Felonious
Posts: 13
Joined: January 28th, 2011, 6:07 am

Problem with random image generator

Post by Felonious »

Thanks to you guys, I think I've finally gotten the hang of the program and think I've put together some pretty cool themes.

On my most recent implementation, though, I think something really basic is eluding me. I'm trying to create a toggle for a random image generator and for whatever reason it's starting a slideshow for every image in the folder rather than bringing up a single image.

Here's the relevant portion of my script:

[MeasureRandom]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName=C:\Users\UserName\Pictures\FolderName\
FileFilter=*.jpg
Subfolders=0

[RandomImage]
MeasureName=MeasureRandom
Meter=IMAGE
X=600
Y=100
Hidden=1

[Icon]
Meter=Image
ImageName=icon.png
X=80
Y=160
W=70
H=70
LeftMouseDownAction=!RainmeterShowMeter RandomImage
LeftMouseUpAction=!Execute [!RainmeterHideMeter Icon][!RainmeterShowMeter IconActive]

[IconActive]
Meter=Image
ImageName=iconactive.png
X=80
Y=160
W=70
H=70
LeftMouseDownAction=!RainmeterHideMeter RandomImage
LeftMouseUpAction=!Execute [!RainmeterHideMeter IconActive][!RainmeterShowMeter Icon]

Basically, what this is does is start up a slideshow in random order and then closes the slideshow when I click the icon again. So the toggle aspect is working, but I want it to bring up a single image rather than cycle through the folder. Then I can toggle it off and have it bring up a new image when I click again.

Like I said, I'm sure the fix is fairly obvious, but I'd appreciate it if you'd point me in the right direction.

Thanks
User avatar
jsmorley
Developer
Posts: 22649
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Problem with random image generator

Post by jsmorley »

Think I would do something like this:

Code: Select all

[MeasureRandom]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName="C:\Users\Jeffrey Morley\uZa\FTP Files"
FileFilter=*.jpg
Subfolders=0

[RandomImage]
MeasureName=MeasureRandom
Meter=IMAGE
X=600
Y=100
Hidden=1

[Icon]
Meter=Image
ImageName=icon.png
X=80
Y=160
W=70
H=70
LeftMouseUpAction=!Execute [!RainmeterShowMeter RandomImage][!RainmeterDisableMeasure MeasureRandom][!RainmeterHideMeter Icon][!RainmeterShowMeter IconActive]

[IconActive]
Meter=Image
ImageName=iconactive.png
X=80
Y=160
W=70
H=70
Hidden=1
LeftMouseUpAction=!Execute [!RainmeterHideMeter RandomImage][!RainmeterEnableMeasure MeasureRandom][!RainmeterHideMeter IconActive][!RainmeterShowMeter Icon]
User avatar
jsmorley
Developer
Posts: 22649
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Problem with random image generator

Post by jsmorley »

Oh, and I would probably add PreserveAspectRatio=1 to [RandomImage]
Felonious
Posts: 13
Joined: January 28th, 2011, 6:07 am

Re: Problem with random image generator

Post by Felonious »

Yep, it works. Thanks!
User avatar
jsmorley
Developer
Posts: 22649
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Problem with random image generator

Post by jsmorley »

My pleasure.