FernanS1 Posted June 25, 2018 Share Posted June 25, 2018 Hey guys, Pretty new to AutoIT (a couple days now), but familiar enough to have been perusing the forums trying to find an answer to my issue, to no avail. All I'm trying to do is import a small JPG onto a GUI I made, but for some reason it is not displaying on the GUI, and I'm not sure why. I have checked the GUICtrlCreatePic Documentation repeatedly and I'm not sure what I'm doing wrong, an explanation would be awesome! Thanks so much! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 25, 2018 Moderators Share Posted June 25, 2018 @FernanS1 welcome to the forum. In the future, please use the code brackets <> to post code. Pictures are for Facebook, and you generally guarantee yourself very little help when you force people to re-type your script. That said, I cannot reproduce your issue. This code works just fine for me: #include <IE.au3> #include <ButtonConstants.au3> #include <GUIConstantsEX.au3> #include <WindowsConstants.au3> $Start_X = 0 $Start_Y = 0 Local $userGUI = GUICreate("Service Engineering Information Input", 350, 440) Local $image = GUICtrlCreatePic(@DesktopDir & "\convention.jpg", 0, 0, 100, 100) GUICtrlSetPos($image, 50, 50, 200, 100) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd It appears from your screenshot the file is being blocked. If you click the Unblock button, does it work then? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Simpel Posted June 26, 2018 Share Posted June 26, 2018 Hi. There are some functions in AutoIt that don't like spaces inside pathes and file names. Possibly this one too? Try to change the name of the jpg to „Logo_Transparent.jpg“. Regards, Conrad SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 26, 2018 Moderators Share Posted June 26, 2018 @Simpel perhaps try your suggestions before posting, rather than leading the OP on a wild goose chase. Spaces are fine as long as you enclose them correctly: #include <IE.au3> #include <ButtonConstants.au3> #include <GUIConstantsEX.au3> #include <WindowsConstants.au3> $Start_X = 0 $Start_Y = 0 Local $userGUI = GUICreate("Service Engineering Information Input", 350, 440) Local $image = GUICtrlCreatePic(@DesktopDir & "\Really long name with lots of spaces.jpg", 0, 0, 100, 100) GUICtrlSetPos($image, 50, 50, 200, 100) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ...works just fine. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
FernanS1 Posted June 26, 2018 Author Share Posted June 26, 2018 @JLogan3o13 I realize what I did wrong. I downloaded a .png file and changed the file extension to a .jpg by renaming it. When I took that same file and converted it to a .jpg via an online converter, it had no issues showing up. Thank you for your help, I really appreciate it! If you have a link for "Forum Etiquette" I would love to look at it, as I see myself having more questions in the future and don't want to irritate anyone! Thanks, Shawn Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 27, 2018 Moderators Share Posted June 27, 2018 @FernanS1 probably your best bet is the forum rules page. This page shows the Do's and Don'ts of posting on the forum. In addition, the general FAQ on the Wiki shows answers to the most oft-asked questions. You may find some direction here for your issue without having to post a question: https://www.autoitscript.com/wiki/FAQ Finally, when all else fails, common sense reigns supreme - we (try to) operate on the "think before you type" motto. Look forward to your future contributions. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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