It is currently February 4th, 2023, 3:10 am

LOAD IMAGE ON SPECIFIC TIME

Get help with creating, editing & fixing problems with skins
vapn.sub
Posts: 7
Joined: February 20th, 2010, 6:25 am

LOAD IMAGE ON SPECIFIC TIME

Post by vapn.sub »

Hi All,

I want to load an image based on specific time say every 30 mins. I am not IT guy and wanted to make meter which shows daylight map I have created. I do not want to download maps from internet it does not fit in my theme.

If anyone who can help me to make meter which load image from local directory on specific GMT time, I will appreciate their help.

cheers,
vapn
wasky1
Posts: 127
Joined: June 10th, 2009, 8:26 am

Re: LOAD IMAGE ON SPECIFIC TIME

Post by wasky1 »

one method is a counter-

[CALC1]
Measure=CALC
Formula=Counter % 96 (or as many images as you have)
Disabled=0

[BACK]
MeasureName=CALC1
Meter=IMAGE
ImageName=%1.png
X=0
Y=0
H=128
W=160


Another method is an image based on time -
[MeasureTime]
Measure=Time
Format="%H"

[BACK]
MeasureName=MeasureTime
Meter=IMAGE
ImageName=%1.png
X=0
Y=0
H=128
W=160

you have to name your images 1,2,3 ect

for example below at 1130 o clock it will show image 113000, if you have an image called 113000

[MeasureTime]
Measure=Time
Format="%H%M%S"

[BACK]
MeasureName=MeasureTime
Meter=IMAGE
ImageName=%1.png
X=0
Y=0
H=128
W=160
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: LOAD IMAGE ON SPECIFIC TIME

Post by Chewtoy »

Code: Select all

[Time]
Measure=Time
Format=%M

[Display00]
MeasureName=Time
Meter=String
IfEqualValue=00
IfEqualAction=!Execute [!RainmeterShowMeter Pic00]
IfAboveValue=00
IfAboveAction=!Execute [!RainmeterHideMeter Pic00]

[Display30]
MeasureName=Time
Meter=String
IfEqualValue=30
IfEqualAction=!Execute [!RainmeterShowMeter Pic30]
IfAboveValue=30
IfAboveAction=!Execute [!RainmeterHideMeter Pic30]

[Pic00]
Meter=Image
Path=....
ImageName=Pic00
X=
Y=
H=
W=
PreserveAspectRatio=
Hidden=1

[Pic30]
Meter=Image
Path=....
ImageName=Pic30
X=
Y=
H=
W=
PreserveAspectRatio=
Hidden=1
One way to do it.
I don't think, therefore I'm not.
vapn.sub
Posts: 7
Joined: February 20th, 2010, 6:25 am

Re: LOAD IMAGE ON SPECIFIC TIME

Post by vapn.sub »

Thanks wasky1,

I was able to load images at every hour with below code ( based on ur suggestion). my image names were 01, 02......24.

[MeasureTime]
Measure=Time
Format="%H"

[BACK]
MeasureName=MeasureTime
Meter=IMAGE
ImageName=%.png
X=0
Y=0
H=128
W=160

Can you suggest some tweaking for every half hour? Your help is highly appreciated.

Thanks again,
vapn
vapn.sub
Posts: 7
Joined: February 20th, 2010, 6:25 am

Re: LOAD IMAGE ON SPECIFIC TIME

Post by vapn.sub »

Thanks Chewtoy,
It seems it will change two images (image00 & image30) at every hour. what do i need it to change 48 images each on specific time? Does that mean that I have to repeat this code several time to suite time. I still have not tried this code. I will do this tonight.

Thanks for your suggestion,
vapn
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: LOAD IMAGE ON SPECIFIC TIME

Post by Chewtoy »

vapn.sub wrote:Thanks Chewtoy,
It seems it will change two images (image00 & image30) at every hour. what do i need it to change 48 images each on specific time? Does that mean that I have to repeat this code several time to suite time. I still have not tried this code. I will do this tonight.

Thanks for your suggestion,
vapn
If you want 48 images I would suggest you do like we do with weather icons.

[Time]
Measure=Time
Format="%H%M"

[Image]
MeasureName=Time
Meter=Image
Path=Path\To\Images\
X=
Y=
W=
H=
PreserveAspectRatio=

And then just name the images 0930, 1000, 1330 and what not. It will check for images every second, but there won't be any images for it to find.
Though you can make the update time a lot longer and then have another time measure make sure you update every half hour. Takes some more code but.. Anyways.
I don't think, therefore I'm not.
vapn.sub
Posts: 7
Joined: February 20th, 2010, 6:25 am

Re: LOAD IMAGE ON SPECIFIC TIME

Post by vapn.sub »

Chewtoy wrote: If you want 48 images I would suggest you do like we do with weather icons.

[Time]
Measure=Time
Format="%H%M"

[Image]
MeasureName=Time
Meter=Image
Path=Path\To\Images\
X=
Y=
W=
H=
PreserveAspectRatio=

And then just name the images 0930, 1000, 1330 and what not. It will check for images every second, but there won't be any images for it to find.
Though you can make the update time a lot longer and then have another time measure make sure you update every half hour. Takes some more code but.. Anyways.
Chewtoy,
It works perfectly and seems more logical too. Only issue is it does not show any image if turn on ur computer at some other time say 0906, 1237 etc. Do u have any solution for that? Sorry if I am bugging too much, I dnt have any scripting experience.

Thanks for ur help
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: LOAD IMAGE ON SPECIFIC TIME

Post by Chewtoy »

Could try to substitute the numbers...
Substitute="01":"00","02":"00","03":"00"..."39":"30"

Get it?
And if it doesn't work straight away, try adding a DynamicVariables=1 to the image-meter.
I don't think, therefore I'm not.
wasky1
Posts: 127
Joined: June 10th, 2009, 8:26 am

Re: LOAD IMAGE ON SPECIFIC TIME

Post by wasky1 »

you could use on your measures -

ifequalvalue=0906
ifequalaction=!Execute [!RainmeterShowMeter sunny]

of course you would need so many calc measures on one time measure
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: LOAD IMAGE ON SPECIFIC TIME

Post by Alex2539 »

I'm going to assume you have 48 images because you want one to load at each half hour. Try this:

Code: Select all

[MeasureHour]
Measure=Time
Format=%H

[MeasureMinute]
Measure=Time
Format=%M

[MeasureImage]
Measure=Calc
Formula=MeasureHour*100+(MeasureMinute<30 ? 0 : 30)+9990000
Substitute="999":""

[Image]
Meter=Image
MeasureName=MeasureImage
ImagePath=blah/blah/blah
...etc.
ImageImageImageImage