Nova 0 Posted November 4, 2004 Ok im trying to place 2 pictures onto a gui with the following code When I run the script only the first picture is displayed and its slightly deformed as if a second picture is trying to display but cant. This is not a position problem as I have the same code written using 2 GUIs and the positions are perfect with no defects. So that begs the question why wont the following code display both pictures in the 1 gui ? #include <GUIConstants.au3> $Menu = GUICreate ( "Novacontrol" ,250 ,300 ,-1 ,-1 ,$WS_POPUP ,-1 ,-1) $Relpos = WinGetPos($Menu) GUISetState (@SW_SHOW) ;Positioning of Layer1 $Layer1=GUICtrlCreatePic("C:\Nova-Menu\Images\Layer 1.bmp",-1,-1, 250,300) ;Positioning of Layer2 $Layer2=GUICtrlCreatePic("C:\Nova-Menu\Images\Layer 2.bmp",$Relpos[0]+63,$Relpos[1]+218, 125,55) while 1 sleep (200) wend Share this post Link to post Share on other sites
Nova 0 Posted November 4, 2004 Woops sry here they are zipped Share this post Link to post Share on other sites
Josbe 1 Posted November 4, 2004 (edited) Simply, it's the order how you defined each control (not this case) BTW: The way to position the pic, maybe isn't very good. Edited November 4, 2004 by josbe AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Share this post Link to post Share on other sites
Nova 0 Posted November 4, 2004 So how come the following line of code with the varibles causes the error ? $Layer2=GUICtrlCreatePic("C:\Nova-Menu\Images\Layer 2.bmp",$Relpos[0]+63,$Relpos[1]+218, 125,55) It works fine without the varibles but I need them in this line of code so as Layer 2 is positioned relative to Layer 1, Otherwise when the screen res is changed the overall position of both layers isnt effected. Share this post Link to post Share on other sites
Josbe 1 Posted November 4, 2004 The resolution isn't affected(AFAIK), because here you define.(GUI creation) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Share this post Link to post Share on other sites
Nova 0 Posted November 4, 2004 (edited) Edit : Ok so now I need to know how I can undisplay the image layer2 so as I can display an image layer 3 in its place. $Layer2=GUICtrlCreatePic("C:\Nova-Menu\Images\Layer 2.bmp",63,51, 125,55) Effectivly im looking for GUIPicDelete() but I cant find anything like that in the help file. How can this be done ? Edited November 4, 2004 by nova Share this post Link to post Share on other sites
Josbe 1 Posted November 4, 2004 (edited) Any ideas ?<{POST_SNAPBACK}>GUICtrlSetState($Layer2, $GUI_HIDE)Or GUICtrlSetImage Edited November 4, 2004 by josbe AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Share this post Link to post Share on other sites
jpm 93 Posted November 5, 2004 Edit : Ok so now I need to know how I can undisplay the image layer2 so as I can display an image layer 3 in its place.$Layer2=GUICtrlCreatePic("C:\Nova-Menu\Images\Layer 2.bmp",63,51, 125,55)Effectivly im looking for GUIPicDelete() but I cant find anything like that in the help file.How can this be done ?<{POST_SNAPBACK}>If you you really want to delete just use GUICtrlDelete($picID ) Share this post Link to post Share on other sites