Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Transparent background


  • Please log in to reply
8 replies to this topic

#1 Freequency

Freequency

    Seeker

  • Active Members
  • 5 posts

Posted 19 February 2010 - 03:35 AM

I'm trying to create two simple buttons, a status message, with a picture that will show through the background. I don't want the buttons to be transparent. Meaning the checkbox's, status message. I can't seem to get the groups to show the image? I've included the script and image. Thanks for any help.

Posted Image

Plain Text         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Please select to continue", 271, 190, 223, 126) $Group1 = GUICtrlCreateGroup("Settings", 8, 8, 257, 97) GUICtrlSetColor(-1, 0xFF0000) $Checkbox1 = GUICtrlCreateCheckbox("Start", 32, 72, 57, 17) $Checkbox2 = GUICtrlCreateCheckbox("Pwned", 192, 72, 57, 17) $Button1 = GUICtrlCreateButton("Start", 24, 24, 73, 41, $WS_GROUP) $Button3 = GUICtrlCreateButton("Pwned!!", 184, 24, 73, 41, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Status", 8, 112, 257, 65) GUICtrlSetColor(-1, 0xFF0000) $Label2 = GUICtrlCreateLabel("What's Next?", 48, 144, 161, 17, $SS_CENTER) GUICtrlCreateGroup("", -99, -99, 1, 1) $Pic1 = GUICtrlCreatePic("freeqavatar.jpg", 0, 0, 268, 188, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUICheckBoxSetColor ( $Checkbox1 ,0x000000,$GUI_BKCOLOR_TRANSPARENT) GUICheckBoxSetColor ( $Checkbox2 ,0x000000,$GUI_BKCOLOR_TRANSPARENT) GUISetState(@SW_SHOW) Func GUICheckBoxSetColor(ByRef $CtrlID,$iColor,$iBkColor="0xF1EDED")     $CtrlHWnd = $CtrlID     If Not IsHWnd($CtrlHWnd) Then $CtrlHWnd = GUICtrlGetHandle($CtrlID)     $aParent = DllCall("user32.dll", "hwnd", "GetParent", "hwnd", $CtrlHWnd)     $aCPos = ControlGetPos($aParent[0],"",$CtrlID)     $sOldT = GUICtrlRead($CtrlID,1)     GUICtrlDelete($CtrlID)     DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 0)     $CtrlID = GUICtrlCreateCheckbox($sOldT,$aCPos[0],$aCPos[1],$aCPos[2],$aCPos[3])     GUICtrlSetColor(-1,$iColor)     GUICtrlSetBkColor(-1,$iBkColor)     DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 7) EndFunc While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit     EndSwitch WEnd








#2 Freequency

Freequency

    Seeker

  • Active Members
  • 5 posts

Posted 19 February 2010 - 05:37 AM

Was playing around with it and I moved
$Pic1 = GUICtrlCreatePic("freeqavatar.jpg", 0, 0, 268, 188, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

right below the
$Form1 = GUICreate("Please select to continue", 271, 190, 223, 126)

Which got me to this image:Capture.JPG
So now how do I get the text to only be visible and not the box around it?

#3 notsure

notsure

    Polymath

  • Active Members
  • PipPipPipPip
  • 210 posts

Posted 19 February 2010 - 09:03 AM

Try this;

$Label2 = GUICtrlCreateLabel("What's Next?", 48, 144, 161, 17, $SS_CENTER) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)


This does not work on checkboxes. The best thing you can do with checkboxes is to create a label next to it, and make the label transparant while the checkbox is minimized till only the "check" is left... i don't know how to get the other controls transparant.

#4 Freequency

Freequency

    Seeker

  • Active Members
  • 5 posts

Posted 19 February 2010 - 12:44 PM

Try this;

$Label2 = GUICtrlCreateLabel("What's Next?", 48, 144, 161, 17, $SS_CENTER) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)


This does not work on checkboxes. The best thing you can do with checkboxes is to create a label next to it, and make the label transparant while the checkbox is minimized till only the "check" is left... i don't know how to get the other controls transparant.

That worked wonderfully, I'll do as you stated and make a label next to them. Thanks for the ideas. Any one know how to get the Groups to show transparent?

#5 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,743 posts

Posted 19 February 2010 - 04:02 PM

Freequency,

Does this help?
$Group2 = GUICtrlCreateGroup("", 8, 112, 257, 65) GUICtrlCreateLabel("Status", 20, 122, 40, 17) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

You can do the top one yourself if you like it! :mellow:

M23

P.S. You need to disable your Pic control if you want the others to work! :(
$Pic1 = GUICtrlCreatePic("freeqavatar.jpg", 0, 0, 268, 188, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUICtrlSetState(-1, $GUI_DISABLE)

Edited by Melba23, 19 February 2010 - 04:04 PM.

StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#6 Freequency

Freequency

    Seeker

  • Active Members
  • 5 posts

Posted 19 February 2010 - 08:54 PM

[quote name='Melba23' date='19 February 2010 - 05:02 PM' timestamp='1266595331' post='775229']
Freequency,

Does this help?
$Group2 = GUICtrlCreateGroup("", 8, 112, 257, 65) GUICtrlCreateLabel("Status", 20, 122, 40, 17) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
You can do the top one yourself if you like it! :mellow:

M23

It sets the status color to white, but I still have the background box around it.
Also I did create the GuiCtrlSetState(-1,$GUI_DISABLE)to activate the script. Didn't put it in the code when I pasted it here.

#7 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,743 posts

Posted 19 February 2010 - 08:59 PM

Freequency,

If you do not want the box, then why are you using GUICtrlCreateGroup? Just leave that line out and just use the label. :mellow:

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#8 Freequency

Freequency

    Seeker

  • Active Members
  • 5 posts

Posted 19 February 2010 - 09:45 PM

Freequency,

If you do not want the box, then why are you using GUICtrlCreateGroup? Just leave that line out and just use the label. :mellow:

M23


Yea, that will have to do.. lol good point!

#9 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,321 posts

Posted 19 February 2010 - 11:39 PM

Yea, that will have to do.. lol good point!


If you want a transparent box then an easy way is to create lines from labels with no text.
EG
GuiCtrlCreateLabel("",10,10,230,2)
GuiCtrlSetBkColor(-1,0x444444)

Possibly a bit late now though :mellow:
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users