Jump to content

GuiCtrlCreateGraphic on top of background picture


Zedna
 Share

Recommended Posts

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...