Jump to content

UDF Ani.au3 - FINALLY ! Animated Gifs and Icons for AutoIt ! with GDIplus


jennico
 Share

Recommended Posts

provides .gif and .ani animation to AutoIt, now supports all gif formats (GIF87a and GIF89a).

v1.6 now even displays dynamic gifs with GDIplus.

Cute and nice additions to your scripts. i hope you like it. Please leave comments.

This is another final and maybe last version, as far as i can see.

The UDF: _Ani.au3

[autoit]#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

#cs

;#=#INDEX#============================================================================================================================#

;# Title .........: _Ani.au3

;# Description ...: Animated Controls (.ani/.gif) for AutoIt.

;# Date ..........: 31.05.09

;# Version .......: 1.6 (some minor bugs fixed, added _Ani_SetGifExFrame)

;# History .......: 26.05.09 v 1.5 (added GDIplus based functions - now all GIFs should be working ! :) , using controlhandles instead of control IDs, bug fixing)

;# 23.05.05 v 1.4 (added _Ani_GetGifInfo(), some errors fixed, accelerated decoding, code cleaning)

;# 22.05.09 v 1.3 (GIF87a support, slow mode for problematic gifs, minor improvements)

;# 21.05.09 v 1.2 (improved timer handling, negative speed, immediate speed reaction, functions added, reduced number of callbacks, minor corrections, code designed)

;# 20.05.09 v 1.1 (added gif support, included timer functions, minor corrections)

;# 19.05.09 v 1.0

;# Author ........: jennico (jennicoattminusonlinedotde)

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

i think i am going to add gif animation. doesn't seem more complicated than ani. i think people would enjoy that.

j.

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

no flickers here.

Edit: there is some flickering on the button and the slider. this is caused by the changing GUI Icon. the controls themselves do not flicker. it should be possible to prevent the client area from repainting on changing GUI Icon.

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

updated script now supports gif animations. quite satisfying, no flickering. No ?

there is a vast variety of gif formats out there, so it will not display every gif file. please send me your not working files so i can improve the code !

moreover i will have to work on the timer functions and add more options. so keep on commenting here until i'm done with this !

j.

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

Very good jennico!

But the flickering is really there...

P.S

About the OnAutoItExit function - It is better to use some unique function name and call other function that might be set by some other UDF, here is an example of how you can do it:

#Region;--------------------------Global declarations
Global $sOnAutoItExit_Opt = Opt("OnExitFunc", "_Ani_OnAutoItExit_Proc")

.....

.....

Func _Ani_OnAutoItExit_Proc()
    Call($sOnAutoItExit_Opt)
    
    FileDelete($ani_TempDir & "*")
EndFunc ;==>_Ani_OnAutoItExit_Proc

BTW: this is how it should be done by every UDF that uses OnAutoItExit function (to avoid conflicts with other UDFs).

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

See the new AutoIt beta

I've seen it, thanks, but it's still beta, we need to make stuff compatible with current versions :) - And besides that, this method should work correctly even with the new version.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

thx.

well, the onexit thing does not work if you use another Opt("OnExitFunc", "__") in the parent script, because the include is executed before the parent script. to make it securely work, the parent script must as well process the same procedure you suggest.

but it's sure a good idea to rename the function.

j.

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

updated v 1.2. now several extensions and improvements, backward movement, timer handling now perfect. the coding is completed, the only thing left for me is to adapt the gif splitting for different file formats like GIF87a. please send or link me to gifs that do not work with my UDF.

thx :)

j.

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

you really take the words out of my mind !

just before i was thinking to myself: what a small amount of lines for so much work ! the code looks so easy in the end.

thx. :)

j.

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

That is the way good code looks, like it was there all the time and just a few lines to do so much. Mine is still in the 500 lines to start a GUI(joking). I always learn something from your code, that is why I jump when I see you have a new script to share...

Link to comment
Share on other sites

i posted v 1.3.

this now supports GIF87a type gifs, too. the splitting is slower, but more precise. so i added the option to use the slow decoder for all types of gifs (flag $hslow=1).

there are still some few kinds of gifs left that cannot be displayed with proper animation. the gif standard allows random frames within the picture, overlaying each other and at any global position. in this way, for example, it is possible to make a figure move in front of a background frame without displaying the background in every single frame (overlaying). or you can tile an image. or interlace it. .... or make the animation wait for user input ...

of course, it is not possible to display all these kinds of gifs properly with the means of AutoIt. but for about 98% of the gif files, my UDF will do it.

i think this project is done now. i have a little thing left in my mind to be done, but it's minor.

so have fun everyone. i am proud for having been able to implement a real new thing to AutoIt !

j.

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

updated to v 1.4. i had several bugs to fix and added a gif analyzing function. this will help interested users to understand this complicated file format.

here is a gif file that cannot be displayed by my UDF. (yes it can ! by now)

Posted Image

if you load it to the example file and click yes to more info, you will see the problem.

maybe i will give it a try, but that's really hard work to do.

cheers j.

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

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...