It is currently April 19th, 2024, 12:33 pm

Animated .GIF files in Rainmeter

Tips and Tricks from the Rainmeter Community
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Animated .GIF files in Rainmeter

Post by jsmorley »

Rainmeter does not support the display of animated .gif files today, but there is a work-around if you want to have a small animated .gif in your skin.

This skin demonstrates how to accomplish this

Code: Select all

;=================================================
; Rainmeter configuration file
; Updated March 7, 2010
;=================================================

;[BEGIN CONFIG FILE]==============================

[Rainmeter]
Author=Jeffrey Morley
Update=100

;Metadata added by RainBrowser
;http://rainmeter.net/cms/Rainmeter101-EditingSkins

[Metadata]
Name=GIF
Config=GIF
Description=Displays a deconstructed .gif file (individual frames) as if it was a .gif file
Instructions=Use the included free GifFrame.exe to deconstruct your .gif file to frames.  Set the output name to simply %
Version=March 7, 2010
Tags=GIF | Animation
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=
Preview=

;End of added Metadata

[ImageMeter]
Meter=Image
ImageName=images\[ImageNumberCalc].jpg
DynamicVariables=1

[ImageNumberCalc]
Measure=Calc
Formula=Counter % 60
Substitute=".00000":""

;[END CONFIG FILE]================================
5.jpg
GIF.zip
Vary the speed and smoothness with "Update=" and set "Formula=Counter % 60" to the number of frames + 1
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Animated .GIF files in Rainmeter

Post by jsmorley »

Transparency is supported if you save the frames as .png files...
an_shark.gif
GIF2.zip
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Animated .GIF files in Rainmeter

Post by jsmorley »

Note - Another way of doing this was outlined by kenz0 in this thread:

http://rainmeter.net/forum/viewtopic.php?f=15&t=1130

I will be creating a "Tips & Tricks" page in the Documentation area of the main site today to showcase both approaches, and so we have an easy place to point folks to when this question comes up in the future.
User avatar
UNleash
Posts: 50
Joined: December 13th, 2009, 4:28 am
Location: North-West Germany

Re: Animated .GIF files in Rainmeter

Post by UNleash »

Just wanted to give feedback -
Both work like a charm.
Win7 32bit latest Rainmeter 1.2 beta (32bit).
Image
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Animated .GIF files in Rainmeter

Post by jsmorley »

User avatar
maminscris
Posts: 509
Joined: April 24th, 2009, 3:17 pm
Location: Bucharest, Romania Lat 44,43° Lon 26,1°

Re: Animated .GIF files in Rainmeter

Post by maminscris »

great
and the shark is funny
Zero at programing, zero at writing codes, so far 2 at making images
But I'm good at copy/paste, and I not always like this
Image
Claymore
Posts: 1
Joined: January 16th, 2010, 2:21 pm

Re: Animated .GIF files in Rainmeter

Post by Claymore »

Hey guys.

I've been trying to make a "button" for Omnimo - custom game icons.

Today I made the first one, Mass Effect 2 themed. But them I saw this thread and I'm trying to make the MouseOverAction reproduce a ME2 logo gif.

First, I tried just making like a normal image, with "Hidden=1" (in ImageMeter and ImageNumberCalc) and "MouseOver" and "MouseLeave" actions. But the code does not behave like a common image meter, and nothing happens.

I'm pretty sure the gif itself is ok, since I tested it without the "hidden=1" and it worked.

So, have you guys any idea of how can I make the code work with hidden/MouseOver&Leaveaction?

Here's how's the code anyway:

Code: Select all

[Rainmeter]
Update=100
MiddleMouseDownAction=!RainmeterRefresh #CURRENTCONFIG#
MouseOverAction=!Execute [!RainmeterShowMeter button] [!RainmeterShowMeter ImageMeter] [!RainmeterShowMeter ImageMeterCalc]
MouseLeaveAction=!Execute [!RainmeterHideMeter button] [!RainmeterHideMeter ImageMeter] [!RainmeterHideMeter ImageMeterCalc]

[Metadata]
Name=Game Button (1)

[Variables]

-------------------------METERS---------------------------

[bg]
Meter=IMAGE
x=0
y=0
ImageName=me201.jpg
Hidden=0

[bg2]
Meter=IMAGE
X=0
y=0
ImageName=me202.jpg
Hidden=1

[button]
Meter=IMAGE
X=20
Y=80
ImageName=button.png
LeftMouseDownAction=!execute ["C:\Program Files\Mass Effect 2\MassEffect2Launcher.exe"]
hidden=1

[ImageMeter]
Meter=Image
ImageName=GIF\[ImageNumberCalc].png
DynamicVariables=1
hidden=1

[ImageNumberCalc]
Measure=Calc
Formula=Counter % 85
Substitute=".00000":""
hidden=1
PS.: If I succeed making those icons and decide to post them @ deviantART I'll give credit to the creator of the gif code (and me, of course) =)
DizzyDaft
Posts: 4
Joined: June 4th, 2010, 9:50 am

Re: Animated .GIF files in Rainmeter

Post by DizzyDaft »

i like very much;

but i do have 1 question how can i make thease frames play in a random order
DizzyDaft
Posts: 4
Joined: June 4th, 2010, 9:50 am

Re: Animated .GIF files in Rainmeter

Post by DizzyDaft »

humm.. been playing around with the gif and i'm seem to having similer probs as claymore

Code: Select all

[Variables]
ShowItems=[!RainmeterShowMeter ImageMeter]
HideItems=[!RainmeterHideMeter ImageMeter]

LeftMouseDownAction=!Execute [!RainmeterShowMeter ImageMeter0]
RightMouseDownAction=!Execute [!RainmeterHideMeter ImageMeter0]

[ImageMeter]
Meter=Image
X=0
Y=0
W=12
H=49
ImageName=../Images/SYNTH/0/[ImageNumberCalc0].png
DynamicVariables=1
Hidden=1

[ImageNumberCalc0]
Measure=Calc
Formula=Counter % 5
Substitute=".00000":""
this way dont work as i can make out (tryed)
and i also tryed with the disabel

Code: Select all

[ImageNumberCalc0]
Measure=Calc
Formula=Counter % 5
Substitute=".00000":""
Disabled=1
i just cant get thing to hide and unhide
any help would be aprechiated :)
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Animated .GIF files in Rainmeter

Post by dragonmage »

The hide/unhide thing is a bug caused by the introduction of dynamicvariables. I believe there is a fix for that particular bug in the 1.2 RC1. In either case though there is a workaround that does just fine, use a variable in Hidden=

Hidden=#MeterNameState#

and use !RainmeterSetVariable to change the variable to 1 or 0 to hide or show.