Phaisius Posted March 9, 2014 Posted March 9, 2014 (edited) Hey guys just wondering why me script isnt displaying a picture, everything works its just the picture will not show up. The only way i can get it to work is if i change the highlighted line (<<<<<<<<<<<<<<<<<<<) to this: $hPic_background = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\Picture.jpg",0,0,0,0) Does any one know why and how i can fix this? expandcollapse popup#include <GUIConstantsEx.au3> Global $hGuiWin = GUICreate ( "Test",458,198) $button1=GuiCtrlCreateButton("African Cichlids",0,0,114,33) $button2=GuiCtrlCreateButton("American Cichlids",0,33,114,33) $button3=GuiCtrlCreateButton("Angel Fishes",0,66,114,33) $button4=GuiCtrlCreateButton("Catfishes",0,99,114,33) $button5=GuiCtrlCreateButton("Characins",0,132,114,33) $button6=GuiCtrlCreateButton("Cyprinids",0,165,114,33) $button7=GuiCtrlCreateButton("Invertebrates",0,198,114,33) $button8=GuiCtrlCreateButton("Killifishes",114,0,114,33) $button9=GuiCtrlCreateButton("Labyrinth",114,33,114,33) $button10=GuiCtrlCreateButton("Live Bearers",114,66,114,33) $button11=GuiCtrlCreateButton("Loaches",114,99,114,33) $button12=GuiCtrlCreateButton("Misc",114,132,114,33) $button13=GuiCtrlCreateButton("Plecos",114,165,114,33) $button14=GuiCtrlCreateButton("Rainbowfishes",114,198,114,33) $hPic_background = GUICtrlCreatePic(@ScriptDir & "...\Images\Picture.jpg",458,198) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSetState($hPic_background, $GUI_DISABLE) GUISetState(@SW_SHOW) While 1 $msg=GuiGetMsg() If $msg=-3 Then Exit If $msg=$button1 Then button1() If $msg=$button2 Then button2() If $msg=$button3 Then button3() If $msg=$button4 Then button4() If $msg=$button5 Then button5() If $msg=$button6 Then button6() If $msg=$button7 Then button7() If $msg=$button8 Then button8() If $msg=$button9 Then button9() If $msg=$button10 Then button10() If $msg=$button11 Then button11() If $msg=$button12 Then button12() If $msg=$button13 Then button13() If $msg=$button14 Then button14() Wend Func button1() GuiCreate("African Cichlids") GuiSetState() EndFunc Func button2() GuiCreate("American Cichlids") GuiSetState() EndFunc Func button3() GuiCreate("Angel Fishes") GuiSetState() EndFunc Func button4() GuiCreate("Catfishes") GuiSetState() EndFunc Func button5() GuiCreate("Characins") GuiSetState() EndFunc Func button6() GuiCreate("Cyprinids") GuiSetState() EndFunc Func button7() GuiCreate("Invertebrates") GuiSetState() EndFunc Func button8() GuiCreate("Killifishes") GuiSetState() EndFunc Func button9() GuiCreate("Labyrinth") GuiSetState() EndFunc Func button10() GuiCreate("Live bearers") GuiSetState() EndFunc Func button11() GuiCreate("Loaches") GuiSetState() EndFunc Func button12() GuiCreate("Misc") GuiSetState() EndFunc Func button13() GuiCreate("Plecos") GuiSetState() EndFunc Func button14() GuiCreate("Rainbowfishes") GuiSetState() EndFunc Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Exit Edited March 9, 2014 by Melba23 Added code tags
Phaisius Posted March 9, 2014 Author Posted March 9, 2014 i Mainly want the picture to rum from the script directory so that the folder with the script can be moved without directory errors
Davide9 Posted March 9, 2014 Posted March 9, 2014 (edited) I think which you must use .gif extension for the pic.. Edited March 9, 2014 by Davide9
Moderators Melba23 Posted March 9, 2014 Moderators Posted March 9, 2014 Phaisius,When you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Phaisius Posted March 9, 2014 Author Posted March 9, 2014 Phaisius, When you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. M23 ok sorry i am a noob at this, my bad, thanks for the help
Phaisius Posted March 9, 2014 Author Posted March 9, 2014 I think which you must use .gif extension for the pic.. I made the picture to .gif and still didnt work?
Danp2 Posted March 9, 2014 Posted March 9, 2014 See the Help entry for @ScriptDir, specifically the part about no trailing backslash. Latest Webdriver UDF Release Webdriver Wiki FAQs
Gianni Posted March 9, 2014 Posted March 9, 2014 if the image you want to load is located in a directory named images and this directory is located in the same path of the running script, then just remove the 3 dot from the above line and change it like this: $hPic_background = GUICtrlCreatePic(@ScriptDir & "\Images\Picture.jpg",458,198) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
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