FredrikIdestam Posted September 21, 2008 Share Posted September 21, 2008 hi friends, i created the following GUI to learn about GUI but on another computer it is not showing image in my GUI. on my pc it is showing the image but on other pc not. #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=F:\Step1.kxf $Form2 = GUICreate("My First GUI", 408, 207, 212, 214) $Pic1 = GUICtrlCreatePic("F:\DreamyWorld.jpg", 0, 0, 404, 204) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd do i need to install autoit on other computers if i want to show my image in GUI on other computer? Link to comment Share on other sites More sharing options...
Andreik Posted September 21, 2008 Share Posted September 21, 2008 hi friends, i created the following GUI to learn about GUI but on another computer it is not showing image in my GUI. on my pc it is showing the image but on other pc not. #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=F:\Step1.kxf $Form2 = GUICreate("My First GUI", 408, 207, 212, 214) $Pic1 = GUICtrlCreatePic("F:\DreamyWorld.jpg", 0, 0, 404, 204) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd do i need to install autoit on other computers if i want to show my image in GUI on other computer? You have picture in F:\DreamyWorld.jpg? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Valuater Posted September 21, 2008 Share Posted September 21, 2008 And, if you plan on using label, buttons, or etc... be sure to disable the pic $Pic1 = GUICtrlCreatePic("F:\DreamyWorld.jpg", 0, 0, 404, 204) GUICtrlSetState( -1, $GUI_DISABLE) 8) Link to comment Share on other sites More sharing options...
FredrikIdestam Posted September 21, 2008 Author Share Posted September 21, 2008 You have picture in F:\DreamyWorld.jpg?yes it's there with the same name and path.And, if you plan on using label, buttons, or etc... be sure to disable the pici have posted the full code my first gui have no buttons, labels, etc only a image. Link to comment Share on other sites More sharing options...
Valuater Posted September 21, 2008 Share Posted September 21, 2008 try this.... #include <GUIConstants.au3> Dim $Pic = "F:\DreamyWorld.jpg" #Region ### START Koda GUI section ### Form=F:\Step1.kxf $Form2 = GUICreate("My First GUI", 408, 207, 212, 214) If Not FileExists($Pic) Then MsgBox(0x0, "ERROR", "The picture file could not be found ", 5) $Pic1 = GUICtrlCreatePic($Pic, 0, 0, 404, 204) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd 8) Link to comment Share on other sites More sharing options...
FredrikIdestam Posted September 21, 2008 Author Share Posted September 21, 2008 on my pc it shows the image but after compiling it and copying to another computer it's not showing any image. only a GUI with nothing. Link to comment Share on other sites More sharing options...
Valuater Posted September 21, 2008 Share Posted September 21, 2008 OK... So we fixed one problem, now there is a new problem... I can help.. one second 8) #include <GUIConstantsEx.au3> $Logo_jpg = @TempDir & "\Logo-au3.jpg" FileInstall("F:\DreamyWorld.jpg", $Logo_jpg) #Region ### START Koda GUI section ### Form=F:\Step1.kxf $Form2 = GUICreate("My First GUI", 408, 207, 212, 214) $Pic1 = GUICtrlCreatePic($Logo_jpg, 0, 0, 404, 204) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd 8) Link to comment Share on other sites More sharing options...
FredrikIdestam Posted September 21, 2008 Author Share Posted September 21, 2008 #include <GUIConstantsEx.au3> $Logo_jpg = @TempDir & "\Logo-au3.jpg" FileInstall("F:\DreamyWorld.jpg", $Logo_jpg) #Region ### START Koda GUI section ### Form=F:\Step1.kxf $Form2 = GUICreate("My First GUI", 408, 207, 212, 214) $Pic1 = GUICtrlCreatePic($Logo_jpg, 0, 0, 404, 204) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd 8) it's working but why should i FileInstall() the image? is it necessary everytime using images in GUI? Link to comment Share on other sites More sharing options...
Valuater Posted September 21, 2008 Share Posted September 21, 2008 it's working but why should i FileInstall() the image?is it necessary everytime using images in GUI?Yes, it is a part of the program and has to be "included" because your friend nor anyone else has that same picture in the same exact location as you do.8) Link to comment Share on other sites More sharing options...
FredrikIdestam Posted September 21, 2008 Author Share Posted September 21, 2008 (edited) Yes, it is a part of the program and has to be "included" because your friend nor anyone else has that same picture in the same exact location as you do.can i include the images in exe and always use them without installing on user's computer? Edited September 21, 2008 by FredrikIdestam Link to comment Share on other sites More sharing options...
Valuater Posted September 21, 2008 Share Posted September 21, 2008 (edited) The way I should you IS how you "include" them. That is the best way AFAIK. Remember that the pic can be erased on autoit exit too. ... I can say that there might be a way to change the pic to data and then "include" it as a file. you will have to look for that UDF in the Example Scripts area. 8) Edited September 21, 2008 by Valuater Link to comment Share on other sites More sharing options...
Zedna Posted September 21, 2008 Share Posted September 21, 2008 can i include the images in exe and always use them without installing on user's computer?Look at my UDF:Add and use binary data to/from resources UDF - embed/use any data/files into/from AutoIt compiled EXE fileshttp://www.autoitscript.com/forum/index.php?showtopic=51103 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
FredrikIdestam Posted September 21, 2008 Author Share Posted September 21, 2008 Look at my UDF:Add and use binary data to/from resources UDF - embed/use any data/files into/from AutoIt compiled EXE fileshttp://www.autoitscript.com/forum/index.php?showtopic=51103thanks. can u give me a example of using your UDF with my code which i have posted in this thread. i tried your UDF but it was complex for me. Link to comment Share on other sites More sharing options...
Zedna Posted September 21, 2008 Share Posted September 21, 2008 thanks. can u give me a example of using your UDF with my code which i have posted in this thread. i tried your UDF but it was complex for me. #AutoIt3Wrapper_useupx=n #AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, DreamyWorld.jpg, rcdata, JPG_1, 0 #AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%" #include <GUIConstants.au3> #include "resources.au3" $Form2 = GUICreate("My First GUI", 408, 207, 212, 214) $Pic1 = GUICtrlCreatePic("", 0, 0, 404, 204) _ResourceSetImageToCtrl($pic1, "JPG_1") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
FredrikIdestam Posted September 21, 2008 Author Share Posted September 21, 2008 #AutoIt3Wrapper_useupx=n #AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, DreamyWorld.jpg, rcdata, JPG_1, 0 #AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%" #include <GUIConstants.au3> #include "resources.au3" $Form2 = GUICreate("My First GUI", 408, 207, 212, 214) $Pic1 = GUICtrlCreatePic("", 0, 0, 404, 204) _ResourceSetImageToCtrl($pic1, "JPG_1") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnddo i need to place my images in the same directory where the au3 is? any extra tools needed for this or it will work fine after compiling as normal au3 files? thanks for the information and help. Link to comment Share on other sites More sharing options...
Zedna Posted September 21, 2008 Share Posted September 21, 2008 do i need to place my images in the same directory where the au3 is?Yes. but only at COMPILE time. At runtime you need only output EXE file.do i need to place my images in the same directory where the au3 is?any extra tools needed for this or it will work fine after compiling as normal au3 files?thanks for the information and help.All is described in my UDF post - just read it! Resources UDF ResourcesEx UDF AutoIt Forum Search 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