Jump to content
Sign in to follow this  
Nova

GUICtrlCreatePic

Recommended Posts

Nova

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

Woops sry here they are zipped

Share this post


Link to post
Share on other sites
Josbe

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 by josbe

Share this post


Link to post
Share on other sites
Nova

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
Nova

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 by nova

Share this post


Link to post
Share on other sites
Nova

Any ideas ?

Share this post


Link to post
Share on other sites
jpm

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×