Sign in to follow this  
Followers 0
Zedna

GuiCtrlCreateGraphic on top of background picture

6 posts in this topic

I need to have picture and on top of it draw by GuiCtrlCreateGraphic

But it seems Graphics is always at bottom (under) of picture.

I searched forum, tried various styles but no luck :whistle:

So can somebody help me with this?

Thanks

Here is my simple example

(only change name of image to something you have on HDD):

#include <GuiConstants.au3>

$GOOYE = GuiCreate("MyGUI", 800, 600)

GUICtrlCreatePic("background.jpg",0,0,500, 500)
GUICtrlSetState(-1, $GUI_DISABLE)

; buttons are OK (over image)
$Button_1 = GuiCtrlCreateButton("Button 1", 10, 10, 50, 20)
$Button_2 = GuiCtrlCreateButton("Button 2", 10, 40, 50, 20)

; but graphics isn't visible, why?
; red cros
$a=GuiCtrlCreateGraphic(50, 50, 100, 100)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff0000)
GUICtrlSetGraphic(-1,$GUI_GR_MOVE, 50,0)
GUICtrlSetGraphic(-1,$GUI_GR_LINE, 50,100)
GUICtrlSetGraphic(-1,$GUI_GR_MOVE, 0,50)
GUICtrlSetGraphic(-1,$GUI_GR_LINE, 100,50)

GuiCtrlSetGraphic ($a, $GUI_GR_REFRESH); attempt to help redraw
   
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Share this post


Link to post
Share on other sites



Graphics is always a background painting.

no possibility to put them on top.

That's the limit of not redesining a specific control. :whistle:

Usualy other control badly work when overlapped.

Share this post


Link to post
Share on other sites

Graphics is always a background painting.

no possibility to put them on top.

That's the limit of not redesining a specific control. :whistle:

Usualy other control badly work when overlapped.

<{POST_SNAPBACK}>

And what about some trick with DllCall, is it possible?

Thanks anyway.

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  
Followers 0