kris Posted March 16, 2006 Share Posted March 16, 2006 I am new but have been doing basic auto script writing and finally decided to mess around with GUI's. Anyway, I have pictures that I use for my splash window and my buttons. I understand that the pictures have to be in the same folder as the script/compiled exe. I have about no knowledge on what im going to ask here but I am going to try make it as clear as possible Is there anyway to put the images into the compiled .exe or a seperate file, instead of a zip file containing the compiled script and pictures. For example I currently have the following setup: TestGui.exe Splash.jpg Button1.bmp Button2.bmp Button3.bmp Here is what I was wondering if its possible: TestGui.exe Images.blah And have the script get the images from the 2nd file or even just have them in the .exe its self. Any information regarding this topic will be greatly appreciated -Kris Link to comment Share on other sites More sharing options...
Valuater Posted March 16, 2006 Share Posted March 16, 2006 (edited) 1Welcome to the forums2FileInstall()is your friend... look it up in help3 to learn alot quickly.....http://www.autoitscript.com/forum/index.php?showtopic=21048#8) Edited March 16, 2006 by Valuater Link to comment Share on other sites More sharing options...
kris Posted March 17, 2006 Author Share Posted March 17, 2006 Alright i'll take a look Thanks for the quick reply Link to comment Share on other sites More sharing options...
kris Posted March 17, 2006 Author Share Posted March 17, 2006 (edited) Alright I messed around with it for a bit and I don't have a clue what I am doing but... I used FileInstall and changed the picture to a .dll and have the program view it from the .dll which is awesome, exactly what I wanted. I don't want to have 5-6 different .dll for each pictures so I was wondering if it's possible to put multiple images in a single .dll file? If so... how would I go about doing that - and how would I call the different images. Thanks. Also I tried that Autoit 1-2-3 program and I kept getting errors on the view demo's/wouldnt let me click Next after answering the first page of questions. Plus- with voice enabled it would just take forever using microsoft sam to talk. Edited March 17, 2006 by kris Link to comment Share on other sites More sharing options...
Valuater Posted March 17, 2006 Share Posted March 17, 2006 (edited) i dont know how you used the DLL... and i dont think you can place muiltiple pics in a DLL ( not sure ) on Welcome to Autoit 123... did you register at the top... BEFORE you took the exam???? microsoft sam can be turned OFF at the tray icon on the errors... did you install SciTE?? 8) Edited March 17, 2006 by Valuater Link to comment Share on other sites More sharing options...
nfwu Posted March 17, 2006 Share Posted March 17, 2006 FileInstall("image1.bmp", @TempDir & "/image1.bmp") SplashImageOn ( "TEST FILEINSTALL", @TempDir & "/image1.bmp" ) Sleep(5000) SplashOff() Exit A small demo program demostrating the use of FileInstall. Breakdown (as usual): FileInstall("image1.bmp", @TempDir & "/image1.bmp")This Line tells the compilier to pack the file "image1.bmp" into the EXE. When the exe is run, the file will be extracted from the exe to @TempDir & "/image1.bmp". SplashImageOn ( "TEST FILEINSTALL", @TempDir & "/image1.bmp" )Display a Splash image using the extracted file at @TempDir & "/image1.bmp" Sleep(5000)Wait for 5 seconds (= 5000 milliseconds) SplashOff()Turn off the splash ExitExit the program Hope this helps #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
kris Posted March 17, 2006 Author Share Posted March 17, 2006 (edited) I have and use SciTE - and I really love it.In Autoit 123 I have registered and I complete all the questions but the next button does not activate.I got the .dll file infomation from the GUICtrlSetImage online document page.link hereWhere if you change the IconID you get a different picture from the shell32.dllSo... I just messed around with InstallFile and did the following:#include <GUIConstants.au3> FileInstall("close.bmp", "test.dll") Opt("GUIOnEventMode", 1) $ConfigWindow = GUICreate("Options", 350, 200) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEConfig") $CloseButton = GUICtrlCreateButton("Close",30, 100, 100, 25, $BS_BITMAP) GUICtrlSetImage (-1, "test.dll") GUICtrlSetTip(-1, "Click to exit.") GUICtrlSetOnEvent($CloseButton, "CLOSEConfig") GUISetState(@SW_SHOW, $ConfigWindow) While 1 Sleep(1000) WEnd Func CLOSEConfig() GUISetState(@SW_HIDE, $ConfigWindow) Exit EndFuncI didn't post my whole script, I just edited this one to meet the needs of what I am trying to do. Attached is the .bmp usedclose.bmp Edited March 17, 2006 by kris Link to comment Share on other sites More sharing options...
nfwu Posted March 17, 2006 Share Posted March 17, 2006 #include <GUIConstants.au3> FileInstall("close.bmp", @TempDir&"\image_close.bmp") Opt("GUIOnEventMode", 1) $ConfigWindow = GUICreate("Options", 350, 200) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEConfig") $CloseButton = GUICtrlCreateButton("Close",30, 100, 100, 25, $BS_BITMAP) GUICtrlSetImage (-1, @TempDir&"\image_close.bmp") GUICtrlSetTip(-1, "Click to exit.") GUICtrlSetOnEvent($CloseButton, "CLOSEConfig") GUISetState(@SW_SHOW, $ConfigWindow) While 1 Sleep(1000) WEnd Func CLOSEConfig() GUISetState(@SW_HIDE, $ConfigWindow) FileDelete(@TempDir&"\image_close.bmp") Exit EndFunc Ok... I think you need an explaination of what fileinstall does... FileInstall("close.bmp", @TempDir&"\image_close.bmp") When you Compile your script to an .exe, the file, "close.bmp", is included in the exe. Which means that the exe can be distributed on it's own, without "close.bmp". When you RUN the exe, the file is extracted to @TempDir&"\image_close.bmp". When you are going to exit the application, it is recommended you delete the extracted files, like so: FileDelete(@TempDir&"\image_close.bmp") Next time read EVERYTHING which people have to tell you (this includes the HelpFile) instead of scanning through... #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
kris Posted March 17, 2006 Author Share Posted March 17, 2006 DOH. I am very sorry for that - It was late at night here and I must have read that way to fast and skipped a line. Thank you for the help 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