taietel Posted February 18, 2011 Share Posted February 18, 2011 It's not compared with Trancexx's, but it works for me. The example resizes with the gui: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Yet Another Gif Example", 250, 400, -1, -1, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME)) ;create the object $oObj = ObjCreate("Shell.Explorer.2") $oObj_ctrl = GUICtrlCreateObj($oObj, 5, 5, 240, 390) ;resize control when the window resizes GUICtrlSetResizing(-1, $GUI_DOCKAUTO) ;restrict right click GUICtrlSetState(-1,$GUI_DISABLE) ;replace this with your own (from local hdd, web, ...): $sGIF = @ScriptDir&"\Dance.gif" ;show the image $URL = "about:<html><body bgcolor='#efefef' scroll='no'><img src='"&$sGIF&"' width='90%' height='100%' border='0'></img></body></html>" $oObj.Navigate($URL) GUISetState(@SW_SHOW) While 1 Sleep(10) Switch GUIGetMsg() Case -3 $oObj=0 ;destroy object... Exit EndSwitch WEnd Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
playlet Posted February 18, 2011 Share Posted February 18, 2011 (edited) --- Edited August 18, 2016 by playlet Link to comment Share on other sites More sharing options...
JScript Posted February 18, 2011 Share Posted February 18, 2011 Depending on the .GIF, it only consumes CPU... I had already done a code, but in some GIFs, the consumption of CPU is greatly exaggerated! expandcollapse popup#include-once ; #INDEX# ======================================================================================================================= ; Title .........: _GUIResourcePic ; AutoIt Version.: 3.2.12++ ; Language.......: English ; Description ...: Load image (.bmp, .jpg, .png, .gif {animated} and other formats.) resources from .exe, .dll, .ocx, .cpl... ; Author ........: João Carlos (jscript) ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_GUICtrlPic_Create ;_GUICtrlPic_Delete ;_GUICtrlPic_SetResizing ;_GUICtrlPic_SetState ;_GUICtrlPic_SetPos ;_GUICtrlPic_GetPos ;_GUICtrlPic_SetImage ; =============================================================================================================================== ; #INTERNAL_USE_ONLY#============================================================================================================ ;_GUICtrlPic_GetSysColor ;============================================================================================================================== ; #VARIABLES# =================================================================================================================== ;Global Const $RT_BITMAP = 2 ;Global Const $RT_STRING = 6 ;Global Const $RT_RCDATA = 10 ;Global Const $RT_MESSAGETABLE = 11 ;Global Const $RT_ANICURSOR = 21 ;Global Const $RT_ANIICON = 22 ;Global Const $RT_HTML = 23 Global $aGRP_OBJECTID[1][5] ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlPic_Create ; Description ...: Creates a Picture control for the GUI. ; Syntax.........: _GUICtrlPic_Create( FileName, [ ResName [, Left [, Top [, Width [, Height [, ResType [, SetBkColor [, Border ]]]]]]]] ) ; Parameters ....: FileName - Filename of the picture or resource to be loaded, supported types: BMP, JPG, PNG, GIF(animated). ; Can be an URL path too. ; ResName - [optional] The name of resource to be load from EXE, DLL, OCX, CPL and other formats. ; Default is -1 (no resource to be loaded, only file of local image). ; Left - [optional] The left side of the control (default is 0). ; Top - [optional] The top of the control (default if 0). ; Width - [optional] The width of the control. Default is -1 (original picture width). ; Height - [optional] The height of the control. Default is -1 (original picture height). ; ResType - [optional] The type of resource to be load. Default is -1 ($RT_RCDATA). ; SetBkColor - [optional] The bgcolor in hex RGB (does not obey opt(colormode)). Default is -1 (transparent). ; Border - [optional] Specifies that a control has a border with a sunken edge. Default is -1 (no border). ; Return values .: Success - Returns the identifier (controlID) of the new control. ; Failure - Returns 0 if picture cannot be created. ; Author ........: João Carlos (jscript) ; Modified.......: ; Remarks .......: This function attempts to embed an 'ActiveX Control' or a 'Document Object' inside the GUI. ; 'Document Objects' will only be visible if the Windows style $WS_CLIPCHILDREN has been used in GUICreate(). ; The GUI functions GUICtrlRead and GUICtrlSet have no effect on this control. The object can only be ; controlled using 'methods' or 'properties' on the $ObjectVar, see: ; 1 - To set or change information in the control see _GUICtrlPic_Set... ; 2 - To update the picture after the dialog box is displayed just use _GUICtrlPic_SetImage. ; 3 - If you want to have a picture having the same size as the file content just use width=height=0 OR -1. ; 4 - Default resizing is $GUI_DOCKSIZE. ; 5 - If a picture is set as a background picture, as the other controls will overlap, it's important to disable ; the pic control and create it after the others controls: _GUICtrlPic_SetState( controlID, $GUI_DISABLE ). ; 6 - The extended style $GUI_WS_EX_PARENTDRAG can be used to allow the dragging of the parent window for windows ; that don't have a titlebar. Just use: GUICtrlSetStyle( controlID[0], -1, $GUI_WS_EX_PARENTDRAG ). ; 7 - If the "SetBkColor" is no set, the background is always set to transparent. GUICtrlSetBkColor() has not ; effect on pic control. ; Related .......: The resource type: $RT_ICON is not supported. ; Link ..........; ; Example .......; _GUICtrlPic_Create( "shell32.dll", 131, 0, 0, -1, -1, $RT_BITMAP ) ; =============================================================================================================================== Func _GUICtrlPic_Create($sFileName, $vResName = -1, $iLeft = 0, $iTop = 0, $iWidth = -1, $iHeight = -1, $vResType = -1, _ $sSetBkColor = -1, $iBorder = -1) Local $oShell, $iActiveXID, $iControlID Local $sInnerHTML = '<img id="image1" SRC="' Local $sIsHttpFile = StringInStr($sFileName, "/", -1, 1) If Not FileExists($sFileName) Then Return SetError(0, 0, 0) If $iWidth = 0 Then $iWidth = -1 If $iHeight = 0 Then $iHeight = -1 If $vResType = -1 Then $vResType = 10 ;$RT_RCDATA If $sIsHttpFile Then $sInnerHTML &= $sFileName ElseIf $vResName = -1 Then $sInnerHTML &= 'file:///' & $sFileName Else $sInnerHTML &= 'res://' & $sFileName & '/' & $vResType & '/' & $vResName EndIf $sInnerHTML &= '">' Switch $sSetBkColor ; 16 colors by name, HTML 4.01 standard Case 'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua' Case $sSetBkColor > -1 And IsNumber($sSetBkColor) $sSetBkColor = Hex($sSetBkColor, 6) Case Else $sSetBkColor = __GUICtrlPic_GetSysColor() EndSwitch If $iBorder = -1 Then $iBorder = 0 Else $iBorder = Abs($iBorder) EndIf $oShell = ObjCreate("Shell.Explorer.2") If @error Then Return SetError(0, 0, 0) $iActiveXID = GUICtrlCreateObj($oShell, $iLeft, $iTop, 0, 0) If $iActiveXID = 0 Then Return SetError(0, 0, 0) $oShell.navigate("about:blank") While $oShell.Busy() Sleep(10) WEnd With $oShell.document .write('<HEAD><TITLE></TITLE><script language="javascript"></script></HEAD>') .write('<body onselectstart="return false" oncontextmenu="return false" onclick="return false" ondragstart="return false" ondragover="return false">') .body.innerHTML = $sInnerHTML .body.topmargin = 0 .body.leftmargin = 0 .body.scroll = "no" .body.bgcolor = $sSetBkColor .body.style.backgroundColor = $sSetBkColor .body.style.borderWidth = $iBorder EndWith $oShell.document.getElementById("image1" ).style.backgroundColor = "transparent" If $iWidth <> -1 Then $oShell.document.getElementById("image1" ).width = $iWidth If $iHeight <> -1 Then $oShell.document.getElementById("image1" ).height = $iHeight $iWidth = $oShell.document.getElementById("image1" ).width $iHeight = $oShell.document.getElementById("image1" ).height GUICtrlSetPos(-1, $iLeft, $iTop, $iWidth, $iHeight) $iControlID = GUICtrlCreateLabel("", $iLeft, $iTop, $iWidth, $iHeight, -1, 0x00000020) ; Dummy control for used by other functions like GUICtrlSetTip... GUICtrlSetBkColor(-1, -2) GUICtrlSetState(-1, 8192 + 2048) ; Default resizing is $GUI_DOCSIZE = 768 ; The automatic resizing event can be disabled if GUIEventOptions(Option) is set to 1. Local $sResizeMode = Opt("GUIResizeMode") If Opt("GUIEventOptions") = 0 And $sResizeMode = 0 Then GUICtrlSetResizing(-1, 768) GUICtrlSetResizing($iActiveXID, 768) ElseIf $sResizeMode > 0 Then GUICtrlSetResizing(-1, $sResizeMode) GUICtrlSetResizing($iActiveXID, $sResizeMode) EndIf For $i = 1 To $aGRP_OBJECTID[0][0] If $aGRP_OBJECTID[$i][0] = $iControlID Then $aGRP_OBJECTID[$i][1] = $oShell $aGRP_OBJECTID[$i][2] = $iActiveXID $aGRP_OBJECTID[$i][3] = $iLeft $aGRP_OBJECTID[$i][4] = $iTop Return $iControlID EndIf Next ReDim $aGRP_OBJECTID[UBound($aGRP_OBJECTID, 1) + 1][5] $aGRP_OBJECTID[0][0] += 1 $aGRP_OBJECTID[$aGRP_OBJECTID[0][0]][0] = $iControlID $aGRP_OBJECTID[$aGRP_OBJECTID[0][0]][1] = $oShell $aGRP_OBJECTID[$aGRP_OBJECTID[0][0]][2] = $iActiveXID $aGRP_OBJECTID[$aGRP_OBJECTID[0][0]][3] = $iLeft $aGRP_OBJECTID[$aGRP_OBJECTID[0][0]][4] = $iTop Return $iControlID EndFunc ;==>_GUICtrlPic_Create Func __GetImageDim($file) ;code by Melba23 - modified by UEZ Local $sFile = StringRegExp($file, "(?i).*\\(.*)", 3) If Not IsArray($sFile) Or @error Then Return SetError(1, 0, 0) Local $sPath = StringRegExp($file, "(?i)(.*)\\.+", 3) If Not IsArray($sFile) Or @error Then Return SetError(1, 0, 0) Local $sDimensions = "" Local $oShellApp = ObjCreate("shell.application") If IsObj($oShellApp) Then Local $oDir = $oShellApp.NameSpace($sPath[0]) If IsObj($oDir) Then Local $oFile = $oDir.Parsename($sFile[0]) If IsObj($oFile) Then If @OSBuild > 6000 Then $sDimensions = $oDir.GetDetailsOf($oFile, 31) ElseIf @OSVersion = "WIN_XP" Then $sDimensions = $oDir.GetDetailsOf($oFile, 26) EndIf EndIf EndIf EndIf If $sDimensions = "" Then Return SetError(1, 0, 0) ;"Object creation failed" Local $aDimensions = StringRegExp($sDimensions, "(?i)[\d]*x*[\d]", 3) If Not IsArray($aDimensions) Then Return SetError(1, 0, 0) ;"Cannot get image resolution!" Return SetError(0, 0, $aDimensions) EndFunc ;==>GetImageDim ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlPic_Delete ; Description ...: Deletes a control returned by _GUICtrlPic_Create. ; Syntax.........: _GUICtrlPic_Delete( controlID ) ; Parameters ....: controlID - The control identifier (controlID) as returned by a _GUICtrlPic_Create function. ; Return values .: Success - Returns 1. ; Failure - Returns 0. ; Author ........: João Carlos (jscript) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; _GUICtrlPic_Delete($iCtrlID) ; =============================================================================================================================== Func _GUICtrlPic_Delete($iCtrlID) Local $aClone[1][5] If $iCtrlID = -1 Then $iCtrlID = __GUIGetLastCtrlID() For $i = 1 To $aGRP_OBJECTID[0][0] If $aGRP_OBJECTID[$i][0] = $iCtrlID Then ContinueLoop ReDim $aClone[UBound($aClone, 1) + 1][5] $aClone[0][0] += 1 For $j = 0 To 4 $aClone[$aClone[0][0]][$j] = $aGRP_OBJECTID[$i][$j] Next Next $aGRP_OBJECTID = $aClone $aClone = 0 GUICtrlSetState(($iCtrlID - 1), 32 + 128) Return GUICtrlDelete($iCtrlID) EndFunc ;==>_GUICtrlPic_Delete ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlPic_SetResizing ; Description ...: Defines the resizing method used by a _GUICtrlPic_Create. ; Syntax.........: _GUICtrlPic_SetResizing( FileName, [ ResName [, Left [, Top [, Width [, Height [, ResType [, SetBkColor [, Border ]]]]]]]] ) ; Parameters ....: controlID - The control identifier (controlID) as returned by a _GUICtrlPic_Create function. ; resizing - The type of resize values to be used, add together multiple values if required. ; See the Docking Values table in the GUICtrlSetResizing Function Reference ; Return values .: Success - Returns 1 ; Failure - Returns 0. ; Author ........: João Carlos (jscript) ; Modified.......: ; Remarks .......: The default resizing for a given control is control dependent see the control doc. ; A default value for any control can be set with GUIResizeMode(Option). ; The automatic resizing event can be disabled if GUIEventOptions(Option) is set to 1. ; Related .......: ; Link ..........; ; Example .......; _GUICtrlPic_SetResizing($iCtrlID, $GUI_DOCKALL) ; =============================================================================================================================== Func _GUICtrlPic_SetResizing($iCtrlID, $iResizing) If $iCtrlID = -1 Then $iCtrlID = __GUIGetLastCtrlID() For $i = 1 To $aGRP_OBJECTID[0][0] If $aGRP_OBJECTID[$i][0] <> $iCtrlID Then ContinueLoop GUICtrlSetResizing($aGRP_OBJECTID[$i][2], $iResizing) Return GUICtrlSetResizing($aGRP_OBJECTID[$i][0], $iResizing) Next Return 0 EndFunc ;==>_GUICtrlPic_SetResizing ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlPic_SetState ; Description ...: Defines the resizing method returned by a _GUICtrlPic_Create. ; Syntax.........: _GUICtrlPic_SetState( controlID, state ) ; Parameters ....: controlID - The control identifier (controlID) as returned by a _GUICtrlPic_Create function. ; state - See the State values below. ; Return values .: Success - Returns 1 ; Failure - Returns 0. ; Author ........: João Carlos (jscript) ; Modified.......: ; Remarks .......: Suported state values: ; _________________________________________________________________________ ; $GUI_SHOW -> Control will be visible. ; $GUI_HIDE -> Control will not be visible. ; $GUI_ENABLE -> Control will be enabled. ; $GUI_DISABLE -> Control will be greyed out. ; $GUI_ONTOP -> Control will be have the ontop attribute for the window . ; ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ; State values can be summed up as: $GUI_DISABLE + $GUI_HIDE sets the control in an disabled and hidden state. ; Related .......: ; Link ..........; ; Example .......; _GUICtrlPic_SetState($iCtrlID, $GUI_HIDE) ; =============================================================================================================================== Func _GUICtrlPic_SetState($iCtrlID, $iState) If $iCtrlID = -1 Then $iCtrlID = __GUIGetLastCtrlID() For $i = 1 To $aGRP_OBJECTID[0][0] If $aGRP_OBJECTID[$i][0] <> $iCtrlID Then ContinueLoop If BitAND($iState, 16) Then $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).style.visibility = "visible" If BitAND($iState, 32) Then $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).style.visibility = "hidden" GUICtrlSetState($aGRP_OBJECTID[$i][2], $iState) Return GUICtrlSetState($aGRP_OBJECTID[$i][0], $iState) Next Return 0 EndFunc ;==>_GUICtrlPic_SetState ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlPic_SetPos ; Description ...: Changes the position of a control _GUICtrlPic_Create in the GUI window. ; Syntax.........: _GUICtrlPic_SetPos( controlID, left, top [, width [, height]] ) ; Parameters ....: controlID - The control identifier (controlID) as returned by a _GUICtrlPic_Create function. ; left - The left side of the control. ; top - The top of the control. ; width - [optional] The width of the control. Default is keyword "Default". ; height - [optional] The height of the control. Default is keyword "Default". ; Return values .: Success - Returns 1 ; Failure - Returns 0. ; Author ........: João Carlos (jscript) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; _GUICtrlPic_SetPos($iCtrlID, $iLeft, $iTop) ; =============================================================================================================================== Func _GUICtrlPic_SetPos($iCtrlID, $iLeft, $iTop, $iWidth = Default, $iHeight = Default) If $iCtrlID = -1 Then $iCtrlID = __GUIGetLastCtrlID() For $i = 1 To $aGRP_OBJECTID[0][0] If $aGRP_OBJECTID[$i][0] <> $iCtrlID Then ContinueLoop $aGRP_OBJECTID[$i][3] = $iLeft $aGRP_OBJECTID[$i][4] = $iTop If $iWidth <> Default And $iWidth <> -1 Then $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).width = $iWidth If $iHeight <> Default And $iHeight <> -1 Then $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).height = $iHeight $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).style.visibility = "hidden" GUICtrlSetPos($aGRP_OBJECTID[$i][2], $iLeft, $iTop, $iWidth, $iHeight) GUICtrlSetPos($aGRP_OBJECTID[$i][0], $iLeft, $iTop, $iWidth, $iHeight) $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).style.visibility = "visible" Return 1;_GUICtrlPic_SetState($iCtrlID, 16) Next Return 0 EndFunc ;==>_GUICtrlPic_SetPos ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlPic_GetPos ; Description ...: Retrieves the position and size of a control returned by _GUICtrlPic_Create relative to it's window. ; Syntax.........: _GUICtrlPic_SetPos( controlID ) ; Parameters ....: controlID - The control identifier (controlID) as returned by a _GUICtrlPic_Create function. ; Return values .: Success - Returns an array containing the size and the control's position relative to it's client window: ; $array[0] = X position ; $array[1] = Y position ; $array[2] = Width ; $array[3] = Height ; Failure - Sets @error to 1. ; Author ........: João Carlos (jscript) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; _GUICtrlPic_GetPos($iCtrlID) ; =============================================================================================================================== Func _GUICtrlPic_GetPos($iCtrlID) Local $aReturn[4] If $iCtrlID = -1 Then $iCtrlID = __GUIGetLastCtrlID() For $i = 1 To $aGRP_OBJECTID[0][0] If $aGRP_OBJECTID[$i][0] <> $iCtrlID Then ContinueLoop $aReturn[0] = $aGRP_OBJECTID[$i][3] $aReturn[1] = $aGRP_OBJECTID[$i][4] $aReturn[2] = $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).width $aReturn[3] = $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).height Return $aReturn Next Return SetError(1, 0, 0) EndFunc ;==>_GUICtrlPic_GetPos ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlPic_SetImage ; Description ...: Sets the picture or resource to be loaded, supported types: BMP, JPG, PNG, GIF(animated). ; Syntax.........: _GUICtrlPic_SetImage( controlID, FileName [, ResName [, ResType [, FixSize ]]] ) ; Parameters ....: controlID - The control identifier (controlID) as returned by a _GUICtrlPic_Create function. ; FileName - Filename of the picture or resource to be loaded, supported types: BMP, JPG, PNG, GIF(animated). ; Can be an URL path too. ; ResName - [optional] The name of resource to be load from EXE, DLL, OCX, CPL and other formats. ; Default is -1 (no resource to be loaded, only file of local image). ; ResType - [optional] The type of resource to be load. Default is -1 ($RT_RCDATA). ; Return values .: Success - Returns 1 ; Failure - Returns 0. ; Author ........: João Carlos (jscript) ; Modified.......: ; Remarks .......: The resource type: $RT_ICON is not supported. ; Related .......: ; Link ..........; ; Example .......; _GUICtrlPic_SetImage($iCtrlID, $iLeft, $iTop) ; =============================================================================================================================== Func _GUICtrlPic_SetImage($iCtrlID, $sFileName, $vResName = -1, $vResType = -1, $lFixSize = True) Local $sInnerHTML = '<img id="image1" SRC="' Local $sIsHttpFile = StringInStr($sFileName, "/", 0, 1) Local $iWidth, $iHeight, $iIsVideo If $iCtrlID = -1 Then $iCtrlID = __GUIGetLastCtrlID() If $sIsHttpFile = 0 And FileExists($sFileName) = 0 Then Return SetError(0, 0, 0) If $vResType = -1 Then $vResType = 10 ;$RT_RCDATA For $i = 1 To $aGRP_OBJECTID[0][0] If $aGRP_OBJECTID[$i][0] <> $iCtrlID Then ContinueLoop $iIsVideo = StringInStr($aGRP_OBJECTID[$i][1] .document.body.outerHTML, "<embed", 0, 1) If StringInStr($sFileName, "<embed", 0, 1) Then $sInnerHTML = $sFileName Else If Not $iIsVideo Then $iWidth = $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).width $iHeight = $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).height EndIf If $sIsHttpFile Then $sInnerHTML &= $sFileName ElseIf $vResName = -1 Then $sInnerHTML &= 'file:///' & $sFileName Else $sInnerHTML &= 'res://' & $sFileName & '/' & $vResType & '/' & $vResName EndIf $sInnerHTML &= '">' EndIf $aGRP_OBJECTID[$i][1] .document.body.innerHTML = $sInnerHTML If $lFixSize And Not $iIsVideo Then $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).width = $iWidth $aGRP_OBJECTID[$i][1] .document.getElementById("image1" ).height = $iHeight EndIf Return 1 Next Return 0 EndFunc ;==>_GUICtrlPic_SetImage ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: _GUICtrlPic_GetSysColor ; Description ...: Returns the system color. ; Syntax.........: _GUICtrlPic_GetSysColor( [ ColorRegion ] ) ; Parameters ....: ColorRegion - [optional] The region of the system color. Default is COLOR_BTNFACE. ; Return values .: Hex color ; Author ........: jscript ; Modified.......: ; Remarks .......: If EzSkin.au3 modified by jscript from original by Valuater is used, return $vDAT_COLOR_BACKGND. ; Related .......: ; Link ..........; ; Example .......; _GUICtrlPic_GetSysColor() ; =============================================================================================================================== Func __GUICtrlPic_GetSysColor($iColorRegion = 15); 15 = COLOR_BTNFACE Local $sGetSysColor ; If EzSkin.au3 modified by jscript from original by Valuater is used... If IsDeclared("vDAT_COLOR_BACKGND") Then Return Hex(Eval("vDAT_COLOR_BACKGND"), 6) $sGetSysColor = DllCall('user32.dll', 'int', 'GetSysColor', 'int', $iColorRegion) $sGetSysColor = Hex($sGetSysColor[0], 6); BGR format ; Converts BGR to RGB color mode Return StringTrimLeft($sGetSysColor, 4) & StringTrimLeft(StringTrimRight($sGetSysColor, 2), 2) & StringTrimRight($sGetSysColor, 4) EndFunc ;==>_GUICtrlPic_GetSysColor ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: _GUIGetLastCtrlID ; Description ...: Returns the last ctrlID referenced ; Syntax ........: _GUIGetLastCtrlID( ) ; Parameters ....: ; Return values .: None ; Author(s) .....: MrCreaTor ; Modified ......: João Carlos (Jscript FROM Brazil) ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func __GUIGetLastCtrlID() Local $aRet = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", GUICtrlGetHandle(-1)) Return $aRet[0] EndFunc ;==>_GUIGetLastCtrlID http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
wakillon Posted February 18, 2011 Share Posted February 18, 2011 Nice ! Is there a way your script support Gif transparency ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
taietel Posted February 18, 2011 Author Share Posted February 18, 2011 Something like this? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinApi.au3> $hGUI = GUICreate("Yet Another Gif Example", 280, 440, -1, -1, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME),$WS_EX_LAYERED) ;create the object $oObj = ObjCreate("Shell.Explorer.2") $oObj_ctrl = GUICtrlCreateObj($oObj, 20, 20, 240, 380) ;resize control when the window resizes GUICtrlSetResizing(-1, $GUI_DOCKAUTO) ;replace this with your own (from local hdd, web, ...): $sGIF = @ScriptDir&"\Dance.gif" ;show the image $URL = "about:<html><body bgcolor='#dedede' scroll='no'><img src='"&$sGIF&"' width='90%' height='100%' border='0'></img></body></html>" $oObj.Navigate($URL) ;restrict right click GUICtrlSetState(-1,$GUI_DISABLE) _WinAPI_SetLayeredWindowAttributes($hGUI,0xdedede) GUISetState(@SW_SHOW) While 1 Sleep(10) Switch GUIGetMsg() Case -3 $oObj=0 ;destroy object... Exit EndSwitch WEnd Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
wakillon Posted February 19, 2011 Share Posted February 19, 2011 Something like this?Not Exactly !I wanted see the background of the gui, not of the desktop... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
playlet Posted February 19, 2011 Share Posted February 19, 2011 (edited) --- Edited August 18, 2016 by playlet Link to comment Share on other sites More sharing options...
taietel Posted February 19, 2011 Author Share Posted February 19, 2011 Thanks for the feedback guys! jscript, thanks for sharing! playlet, I think that's wakillon is after. Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
wakillon Posted February 19, 2011 Share Posted February 19, 2011 Perhaps this:Don't forget to change object size according to your gif ($oObj_ctrl = GUICtrlCreateObj($oObj, 5, 5, 220, 19)).Thanks for your help, but it works only if gui background is blank... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
guinness Posted February 19, 2011 Share Posted February 19, 2011 (edited) Have a look at this >> It might help?! I modified the Example to a Function >> expandcollapse popupGlobal $Test = GUICreate("_GIFImage()", 250, 400) GUISetBkColor(0xFFFFFF, $Test) _GIFImage(@ScriptDir & "\Example_3.gif", 16, 16) GUISetState(@SW_SHOW) While 1 Sleep(10) Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd Func _GIFImage($gi_Image, $gi_Width, $gi_Height, $gi_Left = 5, $gi_Top = 5) Local $gi_WMIService = ObjCreate("Shell.Explorer.2") Local $gi_WMIService_Ctrl = GUICtrlCreateObj($gi_WMIService, $gi_Left, $gi_Top, $gi_Width, $gi_Height) $gi_WMIService.Navigate("about:blank") While $gi_WMIService.Busy() Sleep(10) WEnd Local $gi_GetSystemColour, $gi_ColourRegion = 15 If IsDeclared("vDAT_COLOR_BACKGND") Then Return Hex(Eval("vDAT_COLOR_BACKGND"), 6) ; <<<<< I believe this should be changed to 4 or 5?! $gi_GetSystemColour = DllCall('user32.dll', 'int', 'GetSysColor', 'int', $gi_ColourRegion) $gi_GetSystemColour = Hex($gi_GetSystemColour[0], 6) Local $gi_SystemColour = StringTrimLeft($gi_GetSystemColour, 4) & StringTrimLeft(StringTrimRight($gi_GetSystemColour, 2), 2) & StringTrimRight($gi_GetSystemColour, 4) With $gi_WMIService.document .body.innerHTML = '<img id="_GIFImage" src="' & 'file:///' & $gi_Image & '">' .body.topmargin = 0 .body.leftmargin = 0 .body.scroll = "no" .body.bgcolor = $gi_SystemColour .body.style.backgroundColor = $gi_SystemColour .body.style.borderWidth = 0 EndWith GUICtrlSetState($gi_WMIService_Ctrl, 64) Return 1 EndFunc ;==>_GIFImage Edited February 19, 2011 by guinness UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
playlet Posted February 19, 2011 Share Posted February 19, 2011 (edited) --- Edited August 18, 2016 by playlet Link to comment Share on other sites More sharing options...
wakillon Posted February 19, 2011 Share Posted February 19, 2011 I'm not getting that as transparent, here is an alternative: yes, the result is not perfect, the junction between an animated gif and background gui is not ideal... $gui = GUICreate("Yet Another Gif Example", 250, 250) $guicolor = 0xff0000 GUISetBkColor($guicolor) $oObj = ObjCreate("Shell.Explorer.2") $oObj_ctrl = GUICtrlCreateObj($oObj, 50, 50, 129, 93 ) $sGIFp = "http://img684.imageshack.us/img684/5569/87540020.gif" $oObj.Navigate("about:blank") While $oObj.Busy() Sleep(10) WEnd With $oObj.document .write('<body onselectstart="return false" oncontextmenu="return false" onclick="return false" ondragstart="return false" ondragover="return false">') .body.innerHTML = '<img id="image1" SRC="' & $sGIFp & '">' .body.topmargin = 0 .body.leftmargin = 0 .body.scroll = "no" .body.bgcolor = $guicolor .body.style.borderWidth = 0 EndWith GUICtrlSetState ( $oObj_ctrl, 64 ) GUISetState(@SW_SHOW) While 1 Sleep(10) Switch GUIGetMsg() Case -3 $oObj=0 ;destroy object... Exit EndSwitch WEnd AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
guinness Posted February 19, 2011 Share Posted February 19, 2011 (edited) GIF Images with the ability to change the Background Colour as requested by wakillon.expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Global $GUI = GUICreate("_GIFImage()", 250, 400) GUISetBkColor(0xFFFFFF, $GUI) _GIFImage($Test, @ScriptDir & "\Example_3.gif", 16, 16) GUISetState(@SW_SHOW) While 1 Sleep(10) Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd Func _GIFImage($gi_Handle, $gi_Image, $gi_Width, $gi_Height, $gi_Left = 5, $gi_Top = 5) Local $gi_WMIService = ObjCreate("Shell.Explorer.2") Local $gi_WMIService_Ctrl = GUICtrlCreateObj($gi_WMIService, $gi_Left, $gi_Top, $gi_Width, $gi_Height) $gi_WMIService.Navigate("about:blank") While $gi_WMIService.Busy() Sleep(10) WEnd Local $gi_Result = DllCall("user32.dll", "handle", "GetDC", "hwnd", $gi_Handle) If @error Then Return SetError(@error, @extended, 0) Local $gi_DC = $gi_Result[0] $gi_Result = DllCall("gdi32.dll", "int", "GetBkColor", "hwnd", $gi_DC) If @error Then Return SetError(@error, @extended, 0) Local $gi_GetBkColor = $gi_Result[0] $gi_Result = DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $gi_Handle, "handle", $gi_DC) If @error Then Return SetError(@error, @extended, 0) Local $gi_SystemColour = Hex(BitOR(BitAND($gi_GetBkColor, 0x00FF00), BitShift(BitAND($gi_GetBkColor, 0x0000FF), -16), BitShift(BitAND($gi_GetBkColor, 0xFF0000), 16)), 6) With $gi_WMIService.document .body.innerHTML = '<img id="_GIFImage" src="' & 'file:///' & $gi_Image & '">' .body.topmargin = 0 .body.leftmargin = 0 .body.scroll = "no" .body.bgcolor = $gi_SystemColour .body.style.backgroundColor = $gi_SystemColour .body.style.borderWidth = 0 EndWith GUICtrlSetState($gi_WMIService_Ctrl, 64) Return 1 EndFunc ;==>_GIFImageEdit: I found the answer elsewhere but decided to check how trancexx did it >> and it seems the same way Edited February 19, 2011 by guinness UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
wakillon Posted February 20, 2011 Share Posted February 20, 2011 (edited) GIF Images with the ability to change the Background Colour as requested by wakillon. Thanks to try guinness, but that doesn't work... expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Global $GUI = GUICreate("_GIFImage()", 250, 400) GUISetBkColor ( 0xFF0000, $GUI) _GIFImage ( $GUI, "http://img684.imageshack.us/img684/5569/87540020.gif", 129, 93 ) ; have tried with animated gifs on local drive too... GUISetState(@SW_SHOW) While 1 Sleep(10) Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd Func _GIFImage($gi_Handle, $gi_Image, $gi_Width, $gi_Height, $gi_Left = 5, $gi_Top = 5) Local $gi_WMIService = ObjCreate("Shell.Explorer.2") Local $gi_WMIService_Ctrl = GUICtrlCreateObj($gi_WMIService, $gi_Left, $gi_Top, $gi_Width, $gi_Height) $gi_WMIService.Navigate("about:blank") While $gi_WMIService.Busy() Sleep(10) WEnd Local $gi_Result = DllCall("user32.dll", "handle", "GetDC", "hwnd", $gi_Handle) If @error Then Return SetError(@error, @extended, 0) Local $gi_DC = $gi_Result[0] $gi_Result = DllCall("gdi32.dll", "int", "GetBkColor", "hwnd", $gi_DC) If @error Then Return SetError(@error, @extended, 0) Local $gi_GetBkColor = $gi_Result[0] $gi_Result = DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $gi_Handle, "handle", $gi_DC) If @error Then Return SetError(@error, @extended, 0) Local $gi_SystemColour = Hex(BitOR(BitAND($gi_GetBkColor, 0x00FF00), BitShift(BitAND($gi_GetBkColor, 0x0000FF), -16), BitShift(BitAND($gi_GetBkColor, 0xFF0000), 16)), 6) With $gi_WMIService.document .body.innerHTML = '[img]' & $gi_Image & [/img]' .body.topmargin = 0 .body.leftmargin = 0 .body.scroll = "no" .body.bgcolor = $gi_SystemColour .body.style.backgroundColor = $gi_SystemColour .body.style.borderWidth = 0 EndWith GUICtrlSetState($gi_WMIService_Ctrl, 64) Return 1 EndFunc ;==>_GIFImage Edited February 20, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
guinness Posted February 20, 2011 Share Posted February 20, 2011 (edited) You're right, I haven't tested with GIF images online only Local image(s). The image I tested with worked, but this one clearly doesn't! Will have a look a little more, just curious thats all Edit: The background is returning as White and not Red, this is why it fails. Do you have any other examples of transparent GIFs I could test with? Edited February 20, 2011 by guinness UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
wakillon Posted February 20, 2011 Share Posted February 20, 2011 (edited) You're right, I haven't tested with GIF images online only Local image(s). The image I tested with worked, but this one clearly doesn't! Will have a look a little more, just curious thats all have tried unsucessfull with several transparent animated gifs on local drive too... Edited February 20, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
guinness Posted February 20, 2011 Share Posted February 20, 2011 I tested with white this is why it worked duh! UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
guinness Posted February 20, 2011 Share Posted February 20, 2011 (edited) HaHa >> try this with a Local File expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Global $GUI = GUICreate("_GIFImage()") GUISetBkColor(0xFF00FF, $GUI) GUISetState(@SW_SHOW) ; <<<<< Moved! _GIFImage($GUI, @ScriptDir & "\Example_3.gif", 129, 93) While 1 Sleep(10) Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd Func _GIFImage($gi_Handle, $gi_Image, $gi_Width, $gi_Height, $gi_Left = 5, $gi_Top = 5) Local $gi_WMIService = ObjCreate("Shell.Explorer.2") Local $gi_WMIService_Ctrl = GUICtrlCreateObj($gi_WMIService, $gi_Left, $gi_Top, $gi_Width, $gi_Height) $gi_WMIService.Navigate("about:blank") While $gi_WMIService.Busy() Sleep(10) WEnd Local $gi_Result = DllCall("user32.dll", "handle", "GetDC", "hwnd", $gi_Handle) If @error Then Return SetError(@error, @extended, 0) Local $gi_DC = $gi_Result[0] $gi_Result = DllCall("gdi32.dll", "int", "GetBkColor", "hwnd", $gi_DC) If @error Then Return SetError(@error, @extended, 0) Local $gi_GetBkColor = $gi_Result[0] $gi_Result = DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $gi_Handle, "handle", $gi_DC) If @error Then Return SetError(@error, @extended, 0) Local $gi_SystemColour = Hex(BitOR(BitAND($gi_GetBkColor, 0x00FF00), BitShift(BitAND($gi_GetBkColor, 0x0000FF), -16), BitShift(BitAND($gi_GetBkColor, 0xFF0000), 16)), 6) With $gi_WMIService.document .body.innerHTML = '<img id="_GIFImage" src="' & 'file:///' & $gi_Image & '">' .body.topmargin = 0 .body.leftmargin = 0 .body.scroll = "no" .body.bgcolor = $gi_SystemColour .body.style.backgroundColor = $gi_SystemColour .body.style.borderWidth = 0 EndWith GUICtrlSetState($gi_WMIService_Ctrl, 64) Return 1 EndFunc ;==>_GIFImage Edited February 20, 2011 by guinness UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
guinness Posted February 20, 2011 Share Posted February 20, 2011 And for Online >> expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Global $GUI = GUICreate("_GIFImage()") GUISetBkColor(0xFF00FF, $GUI) GUISetState(@SW_SHOW) ; <<<<< Moved! ;~ _GIFImage($GUI, @ScriptDir & "\Example_3.gif", 129, 93) ; Local. _GIFImage($GUI, "http://img684.imageshack.us/img684/5569/87540020.gif", 129, 93) ; Online. While 1 Sleep(10) Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd Func _GIFImage($gi_Handle, $gi_Image, $gi_Width, $gi_Height, $gi_Left = 5, $gi_Top = 5) Local $gi_WMIService = ObjCreate("Shell.Explorer.2") Local $gi_WMIService_Ctrl = GUICtrlCreateObj($gi_WMIService, $gi_Left, $gi_Top, $gi_Width, $gi_Height) $gi_WMIService.Navigate("about:blank") While $gi_WMIService.Busy() Sleep(10) WEnd Local $gi_Result = DllCall("user32.dll", "handle", "GetDC", "hwnd", $gi_Handle) If @error Then Return SetError(@error, @extended, 0) Local $gi_DC = $gi_Result[0] $gi_Result = DllCall("gdi32.dll", "int", "GetBkColor", "hwnd", $gi_DC) If @error Then Return SetError(@error, @extended, 0) Local $gi_GetBkColor = $gi_Result[0] $gi_Result = DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $gi_Handle, "handle", $gi_DC) If @error Then Return SetError(@error, @extended, 0) Local $gi_SystemColour = Hex(BitOR(BitAND($gi_GetBkColor, 0x00FF00), BitShift(BitAND($gi_GetBkColor, 0x0000FF), -16), BitShift(BitAND($gi_GetBkColor, 0xFF0000), 16)), 6) With $gi_WMIService.document .body.innerHTML = '<img id="_GIFImage" src="' & $gi_Image & '">' .body.topmargin = 0 .body.leftmargin = 0 .body.scroll = "no" .body.bgcolor = $gi_SystemColour .body.style.backgroundColor = $gi_SystemColour .body.style.borderWidth = 0 EndWith GUICtrlSetState($gi_WMIService_Ctrl, 64) Return 1 EndFunc ;==>_GIFImage UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
wakillon Posted February 20, 2011 Share Posted February 20, 2011 And for Online >>Thanks guinness, it's better ! Do you know a way to attenuate the annoying blank line between gif and background ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts 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