Jump to content

GIF Animation


trancexx
 Share

Recommended Posts

I don"t know what i'm doing wrong,but all i can get is a flash of my .gif and then script closes.

Is that for all gif files you have or just that one?

If it's just that one could you upload it somewhere and post link to it.

One more thing. Could you try this script. Animation there is done with bitmaps. Just start the script, go to menu and choose Action -> Initialize Compiler -> Generate Initial DLL and then drop some gif on the treeview on the left. Click on treeview pluses to get to the gif and see if you can view it on the right. (Hope it's not too confusing)

I noticed that I put wrong comment in line of assembly. It should be:

"B8" & SwapEndian($pSleep) & _                          ; mov eax, Sleep
instead of what it says now.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Excellent work!

But Stop / Resume is not working properly. My understanding is that when I press stop the animation should stop at current frame. When pressing resume it should continue playing where it has stopped!

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

Link to comment
Share on other sites

Is that for all gif files you have or just that one?

If it's just that one could you upload it somewhere and post link to it.

One more thing. Could you try this script. Animation there is done with bitmaps. Just start the script, go to menu and choose Action -> Initialize Compiler -> Generate Initial DLL and then drop some gif on the treeview on the left. Click on treeview pluses to get to the gif and see if you can view it on the right. (Hope it's not too confusing)

I noticed that I put wrong comment in line of assembly. It should be:

"B8" & SwapEndian($pSleep) & _                      ; mov eax, Sleep
instead of what it says now.

Wow! I just realized you did the resource compiler script.I have been using that,Love it.And yes i can see my GIFS in the resources preview pane.But not with this one,but i am going to keep tryin.

Link to comment
Share on other sites

Link to comment
Share on other sites

Thanks guys.

@UEZ, that part is working as it should only gets interrupted by processing WM_PAINT message. This is the case for not-transparent gifs because they are drawn using DrawIconEx function which is flicker free. Remove GUIRegisterMsg(15, "_Refresh") part to see it.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Thanks guys.

@UEZ, that part is working as it should only gets interrupted by processing WM_PAINT message. This is the case for not-transparent gifs because they are drawn using DrawIconEx function which is flicker free. Remove GUIRegisterMsg(15, "_Refresh") part to see it.

Thanks. Now it is working as expected!

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

finally, gif animation without block the main process.

excellent work trancexx :D

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Link to comment
Share on other sites

Here's a new example. More gifs used. When you run it first time wait a bit for the download: check first post

#include <WindowsConstants.au3>
#include "GIFAnimation.au3"

Opt("MustDeclareVars", 1)

Global $sTempFolder = @TempDir & "\GIFS"
TrayTip("GIF Download", "Please wait while gifs are downloaded and processed", 0)
DirCreate($sTempFolder)

Global $hGui = GUICreate("GIF Animations", 670, 520);, -1, -1, $WS_OVERLAPPEDWINDOW)


;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Global $sFile = $sTempFolder & "\smiley-computer012.gif"
If Not FileExists($sFile) Then
    InetGet("http://www.freesmileys.org/smileys/smiley-computer012.gif", $sFile)
EndIf

Global $aGIFArrayOfIconHandles
Global $hGIFThread
Global $iGIFTransparent
Global $tFrameCurrent

Global $hGIF = _GUICtrlCreateGIF($sFile, 10, 10, $aGIFArrayOfIconHandles, $hGIFThread, $iGIFTransparent, $tFrameCurrent)
GUICtrlSetTip($hGIF, "Hit him")
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Global $sFile1 = $sTempFolder & "\heart.gif"
If Not FileExists($sFile1) Then
    InetGet("http://i54.photobucket.com/albums/g107/onlinegemini/heart.gif", $sFile1)
EndIf
Global $aGIFArrayOfIconHandles1
Global $hGIFThread1
Global $iGIFTransparent1
Global $tFrameCurrent1

Global $hGIF1 = _GUICtrlCreateGIF($sFile1, 5, 210, $aGIFArrayOfIconHandles1, $hGIFThread1, $iGIFTransparent1, $tFrameCurrent1)
GUICtrlSetTip($hGIF1, "Playing hearts")
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Global $sFile2 = $sTempFolder & "\063.gif"
If Not FileExists($sFile2) Then
    InetGet("http://i338.photobucket.com/albums/n415/glbo/flowers/063.gif", $sFile2)
EndIf
Global $aGIFArrayOfIconHandles2
Global $hGIFThread2
Global $iGIFTransparent2
Global $tFrameCurrent2

Global $hGIF2 = _GUICtrlCreateGIF($sFile2, 307, 10, $aGIFArrayOfIconHandles2, $hGIFThread2, $iGIFTransparent2, $tFrameCurrent2)
GUICtrlSetTip($hGIF2, "Lemonade")
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Global $sFile3 = $sTempFolder & "\hekla.gif"
If Not FileExists($sFile3) Then
    InetGet("http://i241.photobucket.com/albums/ff141/trancexx_bucket/hekla.gif", $sFile3)
EndIf
Global $aGIFArrayOfIconHandles3
Global $hGIFThread3
Global $iGIFTransparent3
Global $tFrameCurrent3

Global $hGIF3 = _GUICtrlCreateGIF($sFile3, 49, 80, $aGIFArrayOfIconHandles3, $hGIFThread3, $iGIFTransparent3, $tFrameCurrent3)
GUICtrlSetTip($hGIF3, "What?")
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Global $sFile4 = $sTempFolder & "\36.gif"
If Not FileExists($sFile4) Then
    InetGet("http://i241.photobucket.com/albums/ff141/trancexx_bucket/36.gif", $sFile4)
EndIf
Global $aGIFArrayOfIconHandles4
Global $hGIFThread4
Global $iGIFTransparent4
Global $tFrameCurrent4

Global $hGIF4 = _GUICtrlCreateGIF($sFile4, 170, 100, $aGIFArrayOfIconHandles4, $hGIFThread4, $iGIFTransparent4, $tFrameCurrent4)
GUICtrlSetTip($hGIF4, "Bug")
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Global $sFile5 = $sTempFolder & "\angry.gif"
If Not FileExists($sFile5) Then
    InetGet("http://www.sherv.net/cm/emo/hello-kitty/angry.gif", $sFile5)
EndIf
Global $aGIFArrayOfIconHandles5
Global $hGIFThread5
Global $iGIFTransparent5
Global $tFrameCurrent5

Global $hGIF5 = _GUICtrlCreateGIF($sFile5, 590, 470, $aGIFArrayOfIconHandles5, $hGIFThread5, $iGIFTransparent5, $tFrameCurrent5)
GUICtrlSetTip($hGIF5, "Angry kitty")
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Global $sFile6 = $sTempFolder & "\marvin.gif"
If Not FileExists($sFile6) Then
    InetGet("http://www.sherv.net/cm/emo/south-park/marvin.gif", $sFile6)
EndIf
Global $aGIFArrayOfIconHandles6
Global $hGIFThread6
Global $iGIFTransparent6
Global $tFrameCurrent6

Global $hGIF6 = _GUICtrlCreateGIF($sFile6, 520, 380, $aGIFArrayOfIconHandles6, $hGIFThread6, $iGIFTransparent6, $tFrameCurrent6)
GUICtrlSetTip($hGIF6, "Marvin")
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Global $sFile7 = $sTempFolder & "\loading.gif"
If Not FileExists($sFile7) Then
    InetGet("http://ostlerinc.com/contact/loading.gif", $sFile7)
EndIf
Global $aGIFArrayOfIconHandles7
Global $hGIFThread7
Global $iGIFTransparent7
Global $tFrameCurrent7

Global $hGIF7 = _GUICtrlCreateGIF($sFile7, 350, 350, $aGIFArrayOfIconHandles7, $hGIFThread7, $iGIFTransparent7, $tFrameCurrent7)
GUICtrlSetTip($hGIF7, "loading")
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Global $sFile8 = $sTempFolder & "\loading2.gif"
If Not FileExists($sFile8) Then
    InetGet("http://www.plosntds.org/images/loading.gif", $sFile8)
EndIf
Global $aGIFArrayOfIconHandles8
Global $hGIFThread8
Global $iGIFTransparent8
Global $tFrameCurrent8

Global $hGIF8 = _GUICtrlCreateGIF($sFile8, 350, 390, $aGIFArrayOfIconHandles8, $hGIFThread8, $iGIFTransparent8, $tFrameCurrent8)
GUICtrlSetTip($hGIF8, "loading")
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Global $hButton = GUICtrlCreateButton("MsgBox", 370, 490, 100, 25)

TrayTip("", "", 0)

GUIRegisterMsg(15, "_Refresh"); WM_PAINT

GUISetState()



While 1
    Switch GUIGetMsg()
        Case - 3
            Exit
        Case $hButton
            MsgBox(64, "Some title", "Just to see is the gifs are blocked by this and vice versa.", 0, $hGui)
    EndSwitch
WEnd


Func _Refresh($hWnd, $iMsg, $wParam, $lParam)

    #forceref $hWnd, $iMsg, $wParam, $lParam

    _RefreshGIF($hGIF, $aGIFArrayOfIconHandles, $hGIFThread, $iGIFTransparent, $tFrameCurrent)
    _RefreshGIF($hGIF1, $aGIFArrayOfIconHandles1, $hGIFThread1, $iGIFTransparent1, $tFrameCurrent1)
    _RefreshGIF($hGIF2, $aGIFArrayOfIconHandles2, $hGIFThread2, $iGIFTransparent2, $tFrameCurrent2)
    _RefreshGIF($hGIF3, $aGIFArrayOfIconHandles3, $hGIFThread3, $iGIFTransparent3, $tFrameCurrent3)
    _RefreshGIF($hGIF4, $aGIFArrayOfIconHandles4, $hGIFThread4, $iGIFTransparent4, $tFrameCurrent4)
    _RefreshGIF($hGIF5, $aGIFArrayOfIconHandles5, $hGIFThread5, $iGIFTransparent5, $tFrameCurrent5)
    _RefreshGIF($hGIF6, $aGIFArrayOfIconHandles6, $hGIFThread6, $iGIFTransparent6, $tFrameCurrent6)
    _RefreshGIF($hGIF7, $aGIFArrayOfIconHandles7, $hGIFThread7, $iGIFTransparent7, $tFrameCurrent7)
    _RefreshGIF($hGIF8, $aGIFArrayOfIconHandles8, $hGIFThread8, $iGIFTransparent8, $tFrameCurrent8)

EndFunc   ;==>_Refresh
Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

a picture,360 degrees to Rotate like panomara picture, how is it make?

this nice idea you code,..,back ,stop,next button 360 to turn a picture.

good works

Thanks.

If I undertood you right you want to rotate the pic. You don't need this for that. Just search the forums.

For example you could use FreeImage by ProgAndy or maybe GDI+ (there are examples around I'm sure).

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Another example. It's a classic splash: check first post

Opt("MustDeclareVars", 1)
Opt("GUICloseOnESC", 1); ESC to exit

; Include GIF engine
#include "GIFAnimation.au3"

; Get file
Global $sTempFolder = @TempDir & "\GIFS"
DirCreate($sTempFolder)
Global $sFile = $sTempFolder & "\Loading....gif"
If Not FileExists($sFile) Then
    TrayTip("GIF Download", "Please wait...", 0)
    InetGet("http://i241.photobucket.com/albums/ff141/trancexx_bucket/Loading.gif", $sFile)
    TrayTip("", "", 0)
EndIf

; Create GUI
Global $hGui = GUICreate("GIF Animations", @DesktopWidth, @DesktopHeight, 0, 0, 0x80000000);$WS_POPUP

; Make it white
GUISetBkColor(0xFFFFFF)

; Set transparency
WinSetTrans($hGui, 0, 170)

; GIF job
Global $aGIFArrayOfIconHandles
Global $hGIFThread
Global $iGIFTransparent
Global $tFrameCurrent

Global $hGIF = _GUICtrlCreateGIF($sFile, (@DesktopWidth - 105) / 2, (@DesktopHeight - 70) / 2, $aGIFArrayOfIconHandles, $hGIFThread, $iGIFTransparent, $tFrameCurrent)

; Show GUI
GUISetState()

; Loop and wait for/till exit
While 1
    If GUIGetMsg() = -3 Then Exit
WEnd

; To clean at some point in a real situation
_GUICtrlDeleteGIF($hGIF, $aGIFArrayOfIconHandles, $hGIFThread, $tFrameCurrent)
$iFrameCurrent = DllStructGetData($tFrameCurrent, 1)

Will download the gif if you don't mind.

I'm not deleting it afterward. It would be in your temp dir in GIFS folder of course.

Exit by ESC.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Could you take the first script and make something similar to windows picture viewer? I got win 7 and the win 7 picture viewer does not work with animated gifs. it doesnt have to be fancy just a foward ans back button.

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

Why don't you do it?

I guess I could, but how would I get the next image in the same folder as the selected gif? (makeing the arrows)

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

The help file and FileFindFirstFile / FileFindNextFile would be a good place to start.

I could be wrong but corgano likely meant something else.

Probably option to switch to a new gif file found in the current folder in preview pane by clicking some right/left arrow.

What do you think about GIFAnimation.au3?

♡♡♡

.

eMyvnE

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