Battery Posted June 23, 2010 Share Posted June 23, 2010 (edited) Can someone give me an example of how I do this? Create GUI - 400x600 Create a button anywhere in the GUI Load an image file (400x600) and put it in the GUI Sleep 10 seconds Replace the old image with a new image (400x600) and put it in the GUI -The button has to be always on top of course, the image will be the background. Thanks guys, I hope it's not so complicated. Edited June 23, 2010 by Battery Link to comment Share on other sites More sharing options...
Zedna Posted June 23, 2010 Share Posted June 23, 2010 (edited) Look at GUICtrlSetImage()All needed is in helpfile also with examples. Edited June 23, 2010 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Battery Posted June 23, 2010 Author Share Posted June 23, 2010 Sorry but I couldn't find what I needed, can you give me an example? Link to comment Share on other sites More sharing options...
Battery Posted June 23, 2010 Author Share Posted June 23, 2010 Can someone give me an example of what I need? I bet it's not so complicated. Link to comment Share on other sites More sharing options...
Zedna Posted June 23, 2010 Share Posted June 23, 2010 Can someone give me an example of what I need? I bet it's not so complicated.Yes. It's really trivial but you must do your homework yourself. We can help you but we will not do whole your work.We are not slaves of lazy people here!Open up Autoit's helpfile and read all basics from there. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Authenticity Posted June 23, 2010 Share Posted June 23, 2010 expandcollapse popup#include <Constants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> Global Const $STM_SETIMAGE = 0x0172 Global Const $iWidth = 200, $iHeight = 200 Global Const $iImgWidth = 200, $iImgHeight = 200 Global $aImages[100] = [0] _Main() Func _Main() Local $hGUI, $hExplorer, $hImageList, $hBmp, $Btn, $Pic $hExplorer = _WinAPI_LoadLibrary("explorer.exe") For $i = 140 To 190 $hBmp = _WinAPI_LoadImage($hExplorer, $i, $IMAGE_BITMAP, $iImgWidth, $iImgHeight, 0) If $hBmp Then $aImages[0] += 1 $aImages[$aImages[0]] = $hBmp EndIf Next ReDim $aImages[$aImages[0]+1] _WinAPI_FreeLibrary($hExplorer) $hGUI = GUICreate("Test", $iWidth, $iHeight) $Pic = GUICtrlCreatePic("", 0, 0, $iWidth, $iHeight) GUICtrlSetState($Pic, $GUI_DISABLE) $Btn = GUICtrlCreateButton("Btn", $iWidth/2-35, $iHeight/2-12, 70, 23) _SetPicRandomImage($Pic) GUISetState() While 1 Switch GUIGetMsg() Case $Btn _SetPicRandomImage($Pic) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd For $i = 1 To $aImages[0] _WinAPI_DeleteObject($aImages[$i]) Next GUIDelete() EndFunc Func _SetPicRandomImage($Ctrl) GUICtrlSendMsg($Ctrl, $STM_SETIMAGE, $IMAGE_BITMAP, 0) GUICtrlSendMsg($Ctrl, $STM_SETIMAGE, $IMAGE_BITMAP, $aImages[Random(1, $aImages[0], 1)]) EndFunc Link to comment Share on other sites More sharing options...
GEOSoft Posted June 24, 2010 Share Posted June 24, 2010 Can someone give me an example of what I need? I bet it's not so complicated.Now that you have an example, could you please stop bumping the thread. Impatience will get you no place around here. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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