It is currently March 28th, 2024, 4:02 pm

An url on the desktop

Get help with creating, editing & fixing problems with skins
PhiliP190
Posts: 14
Joined: November 1st, 2017, 7:09 am

An url on the desktop

Post by PhiliP190 »

Hello. I wish i could have this moving image on my desktop. Any help please ?



It is this URL :
Last edited by PhiliP190 on June 13th, 2018, 5:40 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: An url on the desktop

Post by balala »

PhiliP190 wrote:Hello. I wish i could have this moving image on my desktop. Any help please ?
I suppose the gif is changing from time to time, right? I mean that you probably want to get the currently running animation on your desktop.
Well, this is hard, because Rainmeter can't deal with the animated gifs, but lately the task definitely isn't impossible.
A while ago a few users posted here on the forum a way (and a tool) to can extract the frames of a downloaded animated gif. Here is jsmorley's post about how to complete a such task (including an example skin and the needed tool, gif2frames.exe): https://forum.rainmeter.net/viewtopic.php?p=112226#p112226
Although I didn't check, I suppose the follwoing code could work for you (I modified jsmorley's code, posted in the previously provided link):

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureAnimLoop]
Measure=Calc
Formula=(( MeasureAnimLoop % 8 ) + 1 )
Disabled=1

[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=https://www.meteo60.fr/radars/animation-radar-france.gif
Download=1
DownloadFile=current.gif
ForceReload=1
FinishAction=[!CommandMeasure "MeasureExtract" "Run"]

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!SetOption MeterAnimLoop ImageName "current0000[*MeasureAnimLoop*].png"][!EnableMeasure "MeasureAnimLoop"]

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
DynamicVariables=1
The code works in the following way: first the [MeasureImage] measure downloads the appropriate image. When the download finishes, the FinishAction option of this measure runs the [MeasureExtract] RunCommand plugin measure. If exists (see below), the gif2frame.exe app extracts the frames of the animation, then the FinishAction option of this measure sets up the appropriate ImageName option for the [MeterAnimLoop] Image meter and enables the [MeasureAnimLoop] measure. As result, the Image meter will start showing up the frames, one by one.

IMPORTANT!!! This code will work only if you have the gif2frames.exe executable placed in the DownloadFile folder of the current root config. Make sure you've downloaded (using jsmorley's previous post) and placed it there.
PhiliP190
Posts: 14
Joined: November 1st, 2017, 7:09 am

Re: An url on the desktop

Post by PhiliP190 »

Thank you very much, i'll try it.

That's very nice to have taken time to write such a long and elaborated answer.
s0ulslack

Re: An url on the desktop

Post by s0ulslack »

It'd be nice to see the handful of ppl here encouraging others to actually learn and use rainmeter vs writing their code for them.

I swear some of you have this childish 1 upper attitude trying to show who's alpha nerd.

Please close my account, won't be needing it
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: An url on the desktop

Post by balala »

PhiliP190 wrote:Thank you very much, i'll try it.
Ok, please if you try it out, let me know how did it work.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: An url on the desktop

Post by eclectic-tech »

s0ulslack wrote:It'd be nice to see the handful of ppl here encouraging others to actually learn and use rainmeter vs writing their code for them.

I swear some of you have this childish 1 upper attitude trying to show who's alpha nerd.

Please close my account, won't be needing it
You do realize that tearing apart a working example of code is the best way to learn (maybe not for you) :x

The above code is far from a polished package, and simply demonstrates a technique to convert GIF images to multiple PNG images.
That alone is worth seeing a working example. 8-)

No one here is trying to be an "alha nerd", we all started out as newbie's, and are only active to point new users to some of the thousands of helpful posts made by many users who are smarter than me or you, or the documentation that has been updated continuously by volunteers over the past 8~9 years. :17readbook

Your insight, as a 9-month member, as to the motivation of others is inaccurate... a suggestion on teaching techniques would better serve this community rather than posting your assumptions!

Aside: Thanks to all of the rainmeter forum members who unselfishly try to help others!
Addiction has a price that must be paid by seeing flamer comments like s0ulslack's post, and my reply... my apology and respect go out to all of you.
PhiliP190
Posts: 14
Joined: November 1st, 2017, 7:09 am

Re: An url on the desktop

Post by PhiliP190 »

balala wrote:Ok, please if you try it out, let me know how did it work.
It works. :17good I just had to change the number of gifs as my url turns on 5 gifs and the original poster's one turns on 8 gifs.

So i replaced 8 by 5 in this line of code : Formula=(MeasureAnimLoop % 5) + 1

Now, if that's possible, i would like to reduce the size of the final frame as it take a bit too much of my desktop.

Is this possible ?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: An url on the desktop

Post by balala »

PhiliP190 wrote:I just had to change the number of gifs as my url turns on 5 gifs and the original poster's one turns on 8 gifs.

So i replaced 8 by 5 in this line of code : Formula=(MeasureAnimLoop % 5) + 1
I'm glad you succeeded to update the code to make it to work as needed, but there can be a problem if the number of the frames is changing from an animation to the other. Does it?
PhiliP190 wrote:Now, if that's possible, i would like to reduce the size of the final frame as it take a bit too much of my desktop.

Is this possible ?
It is. Add the desired width and height to the [MeterAnimLoop] Image meter, as W and H options. For example:

Code: Select all

[MeterAnimLoop]
...
W=240
H=180
Along with these two options you can also add a PreserveAspectRatio=1 option to the same Image meter. This option ensures that if any of the animation will have a different aspect ration, it won't be distorted.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: An url on the desktop

Post by balala »

s0ulslack wrote:It'd be nice to see the handful of ppl here encouraging others to actually learn and use rainmeter vs writing their code for them.
And how should I have to do this, in your opinion? I have no idea at all...
Probably you are more skilled then me and you could do this. Feel free to do it.
s0ulslack wrote:I swear some of you have this childish 1 upper attitude trying to show who's alpha nerd.
Please ignore my frequent replies.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: An url on the desktop

Post by jsmorley »

balala wrote:And how should I have to do this, in your opinion? I have no idea at all...
Probably you are more skilled then me and you could do this. Feel free to do it.

Please ignore my frequent replies.
The user account s0ulslack has been deleted at his request. I would have likely banned him in any case. There is no need, and no tolerance, for the kinds of flame-wars so often seen on technical forums, in our community.
Post Reply