It is currently August 20th, 2019, 12:57 pm

Animated gif/png cutting the first few frames

Help with creating, editing & fixing problems with skins
mersan-sama
Posts: 2
Joined: February 6th, 2019, 8:00 pm

Animated gif/png cutting the first few frames

mersan-sama » February 6th, 2019, 8:55 pm

Hello!

I've been trying to add an animated gif on my menu skin and I noticed that it is cutting frames on me. Specifically the first 5-10 frames. I even added the +1 to the counter formula. My animation has 95 frames. Would someone mind taking a look at the code to see if I did anything wrong here?

Code: Select all

[Rainmeter]
Update=120
RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=#1# - Settings
ContextAction=!ActivateConfig "Simple and Clean\settings" "tab s1.ini"
ContextTitle2=Refresh Tab
ContextAction2= !Refresh
ContextTitle3=Unload Tab
ContextAction3= !DeactivateConfig
@include=#SKINSPATH#Simple and Clean\settings\tabs.inc
@include2=#SKINSPATH#Simple and Clean\settings\tab actions.inc

;----------------------------------------------------------------

[MeasureAnimation]
Measure=Calc
Formula=(Counter % 95) +1

[line]
meter=image
solidcolor=137,195,255
w=#W1#
h=(6*#Scale#)
y=(48*#Scale#)

[ImageMeter]
Meter=Image
ImageName=#@#circle2/frame[MeasureAnimation].png
h=(54*#Scale#)
preserveaspectratio=1
DynamicVariables=1
Hidden=1
;AntiAlias=1

; [SquareIdle]
; Meter=Image
; solidcolor=137,195,255
; h=(54*#Scale#)
; w=(54*#Scale#)
; AntiAlias=1
; Hidden=0

;----------------------------------------------------------------

[text]
meter=string
fontface=Titillium Web
text=#1#
fontColor=137,195,255
fontsize=(24*#Scale#)
x=(86*#Scale#)
y=(4*#Scale#)
antialias=1

;----------------------------------------------------------------

[1]
meter=image
imagename=#@##bg#
MouseOverAction=[Play #@#sound\over.wav][!HideMeter SquareIdle][!ShowMeter ImageMeter][!SetOption line solidcolor "0,0,0"][!SetOption text fontcolor "0,0,0,200"][!Update][!Redraw]
MouseLeaveAction=[!ShowMeter SquareIdle][!HideMeter ImageMeter][!SetOption line solidcolor "137,195,255"][!SetOption text fontcolor "137,195,255"][!Update][!Redraw]
LeftMouseUpAction=["#action1#"][Play #@#sound\save2.wav][!Update][!Redraw]
w=#W1#
h=(54*#Scale#)
solidcolor=137,195,255,1
mersan-sama
Posts: 2
Joined: February 6th, 2019, 8:00 pm

Re: Animated gif/png cutting the first few frames

mersan-sama » February 6th, 2019, 9:43 pm

After a bunch of messing around, I think I figured it out.
For anyone else having this problem, be sure to get rid of the 0's in front of your numbers if you are doing: frame[MeasureAnimation].png
User avatar
balala
Rainmeter Sage
Posts: 8534
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Animated gif/png cutting the first few frames

balala » February 7th, 2019, 2:40 pm

mersan-sama wrote:
February 6th, 2019, 9:43 pm
After a bunch of messing around, I think I figured it out.
For anyone else having this problem, be sure to get rid of the 0's in front of your numbers if you are doing: frame[MeasureAnimation].png
Depends on the names of your images. If you don't have the 0s in the names, then the posted code is ok. But if those 0s are there, you can:
  • Rename the images, putting the missing 0s.
  • Modify the [MeasureAnimation] measure, to get the needed 0s:

    Code: Select all

    [MeasureAnimation]
    Measure=Calc
    Formula=(Counter % 95)
    RegExpSubstitute=1
    Substitute="^(.)$":"0\1"
Any of the above method works, but I think the second one is easier to be applied.