peter1234 Posted December 21, 2005 Share Posted December 21, 2005 I have not been able to get animated GIFs to work in AutoIt. They only show the first frame. Is there some reason why they will not work in AutoIt? If not, can someone give me an example of how to use them? No useful results using search. Thanks. Link to comment Share on other sites More sharing options...
gamerman2360 Posted December 21, 2005 Share Posted December 21, 2005 You could make an IE object the size of the picture and navigate to a file that has image tags that point to the animated picture... Link to comment Share on other sites More sharing options...
gamerman2360 Posted December 21, 2005 Share Posted December 21, 2005 (edited) This: <body bgcolor="ECE9D8" marginheight="0" topmargin="0" vspace="0" marginwidth="0" leftmargin="0" hspace="0" style="margin:0; padding:0; overflow:hidden;"><img src="animated pic.gif" /></body>would work for transparent gifs and make the margens 0... Just replace "animated pic.gif" with the picture. To get the page onto a GUI use something like in this example:Opt("ExpandVarStrings", 1) $oIE = ObjCreate("Shell.Explorer.2") GUICreate( "Embedded Web control Test", 640, 580, (@DesktopWidth-640)/2, (@DesktopHeight-580)/2) $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 640, 580) $oIE.navigate("@ScriptDir@\animated.html") GUISetState() While GUIGetMsg() <> -3 WEndBasically ObjCreate() then GUICtrlCreateObj() to the size of the pic. Then navigate to the html file. [edit] O ya... Release the object at the end:$oIE = 0 [edit2] Tell me if it works as I don't currently have an animated pic to test it on. [edit3] Got rid of the verticle scrollbar. Edited December 21, 2005 by gamerman2360 Link to comment Share on other sites More sharing options...
peter1234 Posted December 21, 2005 Author Share Posted December 21, 2005 @gamerman2360: Thanks. I will give it a try. Link to comment Share on other sites More sharing options...
gamerman2360 Posted December 21, 2005 Share Posted December 21, 2005 (edited) If you like UDFs to do the work for you:; Made by Gamerman2360 Func GUICtrlCreateInetPic($filename, $left, $top, $width, $height) $oIE = ObjCreate("Shell.Explorer.2") $ctrlID = GUICtrlCreateObj($oIE, $left, $top, $width, $height) $oIE.navigate("about:blank") $oIE.document.write('<base href="' & @WorkingDir & '">' & _ '<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">' & _ '<img src="' & $filename & '" /></body>') Dim $return[2] = [$ctrlID, $oIE] Return $return EndFuncMake sure you have the beta. Edit: Updated since I learned more about the IE object. Edited June 7, 2006 by gamerman2360 Link to comment Share on other sites More sharing options...
peter1234 Posted December 21, 2005 Author Share Posted December 21, 2005 (edited) Works perfect. Thanks. Note - requires beta. #include <GuiConstants.au3> HotKeySet("{ESC}", "Terminate") Func Terminate() $oIE = 0 Exit EndFunc Opt("ExpandVarStrings", 1) $oIE = ObjCreate("Shell.Explorer.2") GUICreate( "Embedded Web control Test", 640, 580, (@DesktopWidth-640)/2, (@DesktopHeight-580)/2) $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 640, 580) $oIE.navigate("@ScriptDir@\animated.html") GUISetState() While GUIGetMsg() <> -3 WEnd animated.html file <body bgcolor="ECE9D8" marginheight="0" topmargin="0" vspace="0" marginwidth="0" leftmargin="0" hspace="0" style="margin:0; padding:0; overflow-x:hidden; overflow-y:hidden;"><img src="animated gif.gif" /></body> Edited December 21, 2005 by peter1234 Link to comment Share on other sites More sharing options...
kjactive Posted December 21, 2005 Share Posted December 21, 2005 (edited) There are two solutions more gif graphics related, one is to use Cwebpage library and wrapup some html code and last there is the freeware gif activex component - download able from my site with a funny example - checkit out...CWebpage library animated gif example:http://www.sitecenter.dk/latenight/nss-fol...e/Au3Update.exeGif component funny example from site: download both fileshttp://www.sitecenter.dk/latenight/nss-folder/downloadBoth examples come with source code...kjactive Edited December 21, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
peter1234 Posted December 21, 2005 Author Share Posted December 21, 2005 @gamerman2360: I have not been able to get UDF to work. I have tried to debug it but was not able to. Link to comment Share on other sites More sharing options...
peter1234 Posted December 21, 2005 Author Share Posted December 21, 2005 (edited) @gamerman2360: OK. Got UDF working. FileWrite line needs to have all of HTML in one line. #include <GuiConstants.au3> HotKeySet("{ESC}", "Terminate") Func Terminate() $oIE = 0 Exit EndFunc Func GUICtrlCreateAnimatedPic($filename, $left, $top, $width, $height) $ExpandVarStrings = Opt("ExpandVarStrings", 1) If FileExists("@TempDir@\temp131.html") Then FileDelete("@TempDir@\temp131.html") If FileExists("@TempDir@\temp132.gif") Then FileDelete("@TempDir@\temp132.gif") FileWrite("@TempDir@\temp131.html", '<body bgcolor="ECE9D8" marginheight="0" topmargin="0" vspace="0" marginwidth="0" leftmargin="0" hspace="0" style="margin:0; padding:0; overflow:hidden;"><img src="@TempDir@\temp132.gif" /></body>') FileCopy($filename, "@TempDir@\temp132.gif") $oIE = ObjCreate("Shell.Explorer.2") GUICtrlCreateObj($oIE, $left, $top, $width, $height) $oIE.navigate("@TempDir@\temp131.html") Opt("ExpandVarStrings", $ExpandVarStrings) EndFunc GuiCreate("",@DesktopWidth,@Desktopheight,-1,-1) GUISetState () $filename = "C:\animated_gif.gif" $width = 200 $height = 150 $left = @DesktopWidth/2 - $width/2 $top = @Desktopheight/2 - $height/2 GUICtrlCreateAnimatedPic($filename, $left, $top, $width, $height) sleep (10000) $oIE = 0 EXIT Edited December 21, 2005 by peter1234 Link to comment Share on other sites More sharing options...
erebus Posted December 21, 2005 Share Posted December 21, 2005 Check this too:http://www.autoitscript.com/forum/index.php?showtopic=18648 Link to comment Share on other sites More sharing options...
gamerman2360 Posted December 23, 2005 Share Posted December 23, 2005 (edited) I wonder why making it to 2 lines made it not work. [edit] Ah, I see. I tested this: Opt("ExpandVarStrings", 1) MsgBox(0, "Test", '<body bgcolor="ECE9D8" marginheight="0" topmargin="0" vspace="0" marginwidth="0" ' &_ 'leftmargin="0" hspace="0" style="margin:0; padding:0; overflow:hidden;"><img src="@TempDir@\temp132.gif" /></body>')And I guess "&_" causes an error. Changed it to "& _" in the UDF. Also changed it so it returns the control ID. [edit2] Actually I couldn't decide which to have it return between the ID and the object because you can't really do much with GUICtrlCreateObj()s ID so I made it into an array and returned both. Edited December 23, 2005 by gamerman2360 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