mercessb Posted August 12, 2011 Share Posted August 12, 2011 Very nice UDF! Well, my question is what should I do if I only wanted to loop all frames for one time only? Currently, from the UDF is like endless looping. Link to comment Share on other sites More sharing options...
trancexx Posted August 13, 2011 Author Share Posted August 13, 2011 Is the gif made to loop thru frames once? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
mercessb Posted August 14, 2011 Share Posted August 14, 2011 Is the gif made to loop thru frames once?Yup Link to comment Share on other sites More sharing options...
trancexx Posted August 14, 2011 Author Share Posted August 14, 2011 YupWell, show it to me. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
mercessb Posted August 15, 2011 Share Posted August 15, 2011 attached Link to comment Share on other sites More sharing options...
trancexx Posted August 15, 2011 Author Share Posted August 15, 2011 And you still don't think you posted in the wrong thread? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
UEZ Posted September 10, 2011 Share Posted September 10, 2011 (edited) How to release the resources from the GIF animation properly to avoid memory leak when calling animation several times from same application? Because each time I'm calling the animation it will not release approx. 8 mb of memory. I used: _GIF_DeleteGIF($hAnim) _GIF_ExitAnimation($hAnim) whereas $hAnim is the handle to the animated GIF! Br, UEZ Edited September 10, 2011 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 More sharing options...
trancexx Posted September 13, 2011 Author Share Posted September 13, 2011 (edited) How to release the resources from the GIF animation properly to avoid memory leak when calling animation several times from same application? Because each time I'm calling the animation it will not release approx. 8 mb of memory. I used: _GIF_DeleteGIF($hAnim) _GIF_ExitAnimation($hAnim) whereas $hAnim is the handle to the animated GIF! Br, UEZ It's related to stream object used for inline/variable images. I'm not releasing it. If you have the latest AutoIt beta then you can add this line: ; Call Release on stream object DllCallAddress("dword", DllStructGetData(DllStructCreate("ptr QueryInterface; ptr AddRef; ptr Release;", DllStructGetData(DllStructCreate("ptr pObj;", $pStream), "pObj")), "Release"), "ptr", $pStream) ... before returning $pBitmap in _GIF_CreateBitmapFromBinaryImage. edit: and $pStream should now be: Local $pStream = _GIF_CreateStreamOnHGlobal($pMemory, 0) Sorry for late reply. I'll rewrite this UDF when new AutoIt release happens to handle streams as they should be (as objects). Edited September 13, 2011 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
UEZ Posted September 13, 2011 Share Posted September 13, 2011 (edited) Yes, it is working with the beta version - the memory is released properly when calling the animation again. No way to get it work without using DllCallAddress()? Because beta is beta and not final. THANKS! Br, UEZ Edited September 13, 2011 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 More sharing options...
UEZ Posted September 13, 2011 Share Posted September 13, 2011 This is also working: ; Call Release on stream object Local $pStream = _GIF_CreateStreamOnHGlobal($pMemory, 0) ;~ DllCallAddress("dword", DllStructGetData(DllStructCreate("ptr QueryInterface; ptr AddRef; ptr Release;", DllStructGetData(DllStructCreate("ptr pObj;", $pStream), "pObj")), "Release"), "ptr", $pStream) Local $tVARIANT = DllStructCreate("word vt;word r1;word r2;word r3;ptr data; ptr") DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $pStream, "dword", 8 + 8 * @AutoItX64, _ "dword", 4, "dword", 23, "dword", 0, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tVARIANT)) Code by ProgAndy! Br, 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 More sharing options...
KaFu Posted September 13, 2011 Share Posted September 13, 2011 No way to get it work without using DllCallAddress()? Because beta is beta and not final.That's what I thought too , thanks to you and ProgAndy for another solution... btw, the UDF looks really nice too ! OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
happytc Posted September 13, 2011 Share Posted September 13, 2011 (edited) Great work! I tried it and found that it couldnot show some types of giflike this GIF: http://min.us/mbgxauuI0Dlike this GIF: http://min.us/mba4qH1JPa Edited September 13, 2011 by happytc Link to comment Share on other sites More sharing options...
trancexx Posted September 13, 2011 Author Share Posted September 13, 2011 (edited) Both of those work for me. Are you sure you are using the function right? #include <WindowsConstants.au3> #include "GIFAnimation.au3" Opt("GUICloseOnESC", 1); ESC to exit Opt("MustDeclareVars", 1) Global $bGif = InetRead("http://k.minus.com/i8VVTsnKNtfHo.gif") Global $aGIFDimension = _GIF_GetDimension($bGif) Global $hGui = GUICreate("GIF Animation", 4 * $aGIFDimension[0], 4 * $aGIFDimension[1], -1, -1, $WS_POPUP, $WS_EX_TOPMOST) Global $hGIF = _GUICtrlCreateGIF($bGif , "", 10, 10, 4 * $aGIFDimension[0], 4 * $aGIFDimension[1]) GUICtrlSetTip($hGIF, "Esc to Exit...") GUICtrlSetPos($hGIF, 0, 0) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd Edited September 13, 2011 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
happytc Posted September 13, 2011 Share Posted September 13, 2011 Both of those work for me. Are you sure you are using the function right? I used the example code of post #1 Then I found some types of gif not to be shown.The following gif could be shown on my computerhttp://min.us/mbn1rs4ZOm -------------------------System: WinXP-SP3 Link to comment Share on other sites More sharing options...
trancexx Posted September 13, 2011 Author Share Posted September 13, 2011 (edited) I used the example code of post #1 Then I found some types of gif not to be shown. The following gif could be shown on my computer http://min.us/mbn1rs4ZOm ------------------------- System: WinXP-SP3 This works for you? #include "GIFAnimation.au3" Global $hGUI = GUICreate("Example", 500, 500) Global $hImage = _GUICtrlCreateGIF(_Img(), "", 100, 100, Default, Default) GUICtrlSetTip($hImage, "I'm on server") GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $hImage If $hImage Then MsgBox(0, 'Aha!', 'Clicked!', 0, $hGUI) EndSwitch WEnd Func _Img() Return InetRead("http://k.minus.com/i1wrAFXCYSSOF.gif") EndFunc Edited September 13, 2011 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
happytc Posted September 13, 2011 Share Posted September 13, 2011 This works for you? #include "GIFAnimation.au3" Global $hGUI = GUICreate("Example", 500, 500) Global $hImage = _GUICtrlCreateGIF(_Img(), "", 100, 100, Default, Default) GUICtrlSetTip($hImage, "I'm on server") GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $hImage If $hImage Then MsgBox(0, 'Aha!', 'Clicked!', 0, $hGUI) EndSwitch WEnd Func _Img() Return InetRead("http://k.minus.com/i1wrAFXCYSSOF.gif") EndFunc Yeah, it's work fine! what's different? Link to comment Share on other sites More sharing options...
trancexx Posted September 13, 2011 Author Share Posted September 13, 2011 Yeah, it's work fine! what's different?Different? Compared to what? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
happytc Posted September 14, 2011 Share Posted September 14, 2011 Oh, I was wrong.I thought the file(http://k.minus.com/i1wrAFXCYSSOF.gif) was the file not to be shown(like: http://min.us/mba4qH1JPa) Link to comment Share on other sites More sharing options...
happytc Posted September 14, 2011 Share Posted September 14, 2011 But why some kinds of GIF files work, some kinds of GIF files don't work? Link to comment Share on other sites More sharing options...
trancexx Posted September 14, 2011 Author Share Posted September 14, 2011 But why some kinds of GIF files work, some kinds of GIF files don't work?Do you have any GIF that it doesn't work for? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now