Jump to content

Animate UDF


Yashied
 Share

Recommended Posts

LAST VERSION - 1.2

27-Dec-11

This UDF helps you to create animated icon in the system tray (only one icon can be used). Very easy to use! I hope that it will be useful for someone. To work properly the example which is shown below, you need to download an archive containing the necessary icons. Any feedback and suggestions please.

Flag.gif

Available functions

_Animate_AddIcon

_Animate_IsAnimate

_Animate_LoadFromBitmap

_Animate_LoadFromFile

_Animate_SetDelay

_Animate_ShowIcon

_Animate_Start

_Animate_Stop

_Animate_Release

Animate UDF Library v1.2

Previous downloads: 1112

Animate.zip

Example

#Include <GUIConstantsEx.au3>
#Include <SliderConstants.au3>
#Include <StaticConstants.au3>
#Include <WindowsConstants.au3>

#Include "Animate.au3"

Opt('MustDeclareVars', 1)
Opt('TrayAutoPause', 0)

Global $Button, $Slider, $Msg

_Animate_LoadFromFile(@ScriptDir & '\Flag.png')

;~For $i = 1 To 12
;~  _Animate_AddIcon(@ScriptDir & '\Flag\' & $i & '.ico', 0)
;~Next

_Animate_SetDelay(50)
_Animate_ShowIcon()

GUICreate('Animation Test', 400, 110)
GUICtrlCreateLabel('Fast', 10, 30, 28, 14, $SS_RIGHT)
GUICtrlCreateLabel('Slow', 355, 30, 28, 14)
$Slider = GUICtrlCreateSlider(42, 25, 310, 26, BitOR($TBS_AUTOTICKS, $WS_TABSTOP))
GUICtrlSendMsg(-1, $TBM_SETTICFREQ, 10, 0)
GUICtrlSetLimit(-1, 250, 10)
GUICtrlSetData(-1, 50)
$Button = GUICtrlCreateButton('Start', 160, 75, 80, 25)
GUICtrlSetState(-1, BitOR($GUI_DEFBUTTON, $GUI_FOCUS))
GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $Slider
            _Animate_SetDelay(GUICtrlRead($Slider))
        Case $Button
            If _Animate_IsAnimate() Then
                GUICtrlSetData($Button, 'Start')
                _Animate_Stop()
            Else
                GUICtrlSetData($Button, 'Stop')
                _Animate_Start()
            EndIf
    EndSwitch
WEnd
Edited by Yashied
Link to comment
Share on other sites

Nice work Yashied! In my opinion it is usefull because having just the standard icon in the taskbar an animated one looks much better!

What might be unfavorable is to have a lot of .ico files for animation. Is it possible to use animated GIFs/PNGs?

Thanks for sharing.

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Nice work Yashied! In my opinion it is usefull because having just the standard icon in the taskbar an animated one looks much better!

What might be unfavorable is to have a lot of .ico files for animation. Is it possible to use animated GIFs/PNGs?

Thanks for sharing.

UEZ

Well, Gif`s not ideal, because they do not support full transparency, but I thought about PNG.
Link to comment
Share on other sites

Thanks for the update Yashied! Now supporting animated PNGs :)

Are animated GIFs also supported? I tried one but no animation - just a still picture.

Further, how can I create animated PNGs? Or convert animated GIFs to PNGs?

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Thanks for the update Yashied! Now supporting animated PNGs :)

Are animated GIFs also supported? I tried one but no animation - just a still picture.

Further, how can I create animated PNGs? Or convert animated GIFs to PNGs?

UEZ

1. GIF`s are not supported. This is antiquity. :)

2. The easiest way - Photoshop (ImageReady), also there are many programs to do so. Creating animated PNG`s goes beyond this work.

Link to comment
Share on other sites

  • 1 year later...

Real nice but it is a shame we can't make them bigger. Size seems to only support 192 x 16, am I correct?

I think it would be real cool to be able to do this bigger and as a GUI. I have about 5000 png strips. LOL

From Pac-man to war png files.

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...
  • 1 month later...

The library has been updated.

v1.2

  • Improved icons display that were loaded from the PNG files by using _Animate_LoadFromBitmap() or _Animate_LoadFromFile() functions.
  • The title of the AutoIt window now does not change.
  • Code improvement.

Edited by Yashied
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...