charvi Posted December 7, 2008 Posted December 7, 2008 Hello, Is there a way to put text directly on the image (or any other graphic element) without getting a flat background? #include <GUIConstantsEx.au3> dim $s_Info="Info on image" $h_Win = GUICreate("Title", 800, 600, 0, 0) $h_Pic = GUICtrlCreatePic("mire.bmp", 0, 0, 800, 600) GUISetState() GUICtrlCreateLabel($s_Info,100,100,500,20) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd
Valuater Posted December 7, 2008 Posted December 7, 2008 Maybe... #include <GUIConstantsEx.au3> Global $s_Info = "Info on image" $h_Win = GUICreate("Title", 800, 600, 0, 0) $h_Pic = GUICtrlCreatePic("mire.bmp", 0, 0, 800, 600) GUICtrlSetState( -1, $GUI_DISABLE) GUICtrlCreateLabel($s_Info, 100, 100, 500, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd 8)
charvi Posted December 7, 2008 Author Posted December 7, 2008 Yes Valuater, that's the correct solution. Thank you! Also thanks for remembering me to use Global instead of Dim (despite it's just a test). But why do you disable the GUI? I don't see any difference when I remark this line. GUICtrlSetState( -1, $GUI_DISABLE)
Valuater Posted December 7, 2008 Posted December 7, 2008 Yes Valuater, that's the correct solution. Thank you! Also thanks for remembering me to use Global instead of Dim (despite it's just a test). But why do you disable the GUI? I don't see any difference when I remark this line. GUICtrlSetState( -1, $GUI_DISABLE)oÝ÷ Ûú®¢×zW(í÷aë+yǧ¶.׫²Ö§w®±ê®¢Ñ¥¡¶¥ªê-jwg¢Ú®¢Ð⫨µ*Â)eØ^æµê鮨µê®¢Ñ¥¡¶¥ªê-N¬jëh×6GUICtrlSetState( -1, $GUI_DISABLE) is not to disable the GUI, but to disable the picture as any type of control. That way you can place buttons etc on top of the picture and receive the message when the button is pressed. otherwise without disabling the pic, a button on top will not work 8)
charvi Posted December 7, 2008 Author Posted December 7, 2008 is not to disable the GUI, but to disable the picture as any type of control.Ah, that's very interesting. Soon I was planning to place buttons on pictures, and would be surprised that they don't work So your explanation is much valuable. Thanks!
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