Sign in to follow this  
Followers 0
charvi

Transparent Label over Image?

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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¢Ú®¢Ð⫨µ*Â)^­æµê鮨µê®¢Ñ¥¡¶¥ªê-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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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!

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