Jamie2312 0 Posted May 20, 2006 Hey everyone!I have made a program but for some reason the image that I want in the background is not allowing the buttons on the form to be pressed. Could someone please tell me the code to put an image in the background. Here is the code which I currently have:$Pic1 = GUICtrlSetImage("E:\OP source\layout.jpg", 0, 0, 857, 623)Thanks! Share this post Link to post Share on other sites
SmOke_N 210 Posted May 20, 2006 (edited) Hey everyone! I have made a program but for some reason the image that I want in the background is not allowing the buttons on the form to be pressed. Could someone please tell me the code to put an image in the background. Here is the code which I currently have: $Pic1 = GUICtrlSetImage("E:\OP source\layout.jpg", 0, 0, 857, 623) Thanks!$Pic1 = GUICtrlSetImage("E:\OP source\layout.jpg", 0, 0, 857, 623) GUICtrlSetState($Pic1, $GUI_DISABLE) Edited May 20, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
Jamie2312 0 Posted May 20, 2006 $Pic1 = GUICtrlSetImage("E:\OP source\layout.jpg", 0, 0, 857, 623) GUICtrlSetState($Pic1, $GUI_DISABLE) When the background image is not in the folder, it does not load. Is there anyway in which the image can be used and not seen by the user? I could download it from a website address but this would take time to download. Share this post Link to post Share on other sites
SmOke_N 210 Posted May 20, 2006 When the background image is not in the folder, it does not load. Is there anyway in which the image can be used and not seen by the user? I could download it from a website address but this would take time to download.If you are compiling your program, you can use FileInstall('DirectPath to FileInstall FROM', 'Path to install to', [optional flag]), and then place it in the temp directory or something. Example:#include <GUICONSTANTS.AU3> FileInstall('C:\MyPics\MyPic.jpg', @TempDir & '\2930fas09dfjw3fnm0.jpg', 1) Opt('OnExitFunc', '_DeleteInstalledFiles') $MainGUI = GUICreate('') $Pic1 = GUICtrlCreatePic(@TempDir & '\2930fas09dfjw3fnm0.jpg', 0, 0, 857, 623) GUICtrlSetState($Pic1, $GUI_DISABLE) GUISetState() While 1 $GetGUIMSG = GUIGetMsg() If $GetGUIMSG = - 3 Then Exit Sleep(10) WEnd Func _DeleteInstalledFiles() FileDelete(@TempDir & '\2930fas09dfjw3fnm0.jpg') EndFunc***Note you can use OnAutoItExit() Function also instead of _DeleteInstalledFiles() or the Opt(). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites