Phantomasss Posted May 12, 2009 Share Posted May 12, 2009 (edited) Hello, ok, i create a my gui, code:expandcollapse popup#include <WindowsConstants.au3> #include <GUIConstants.au3> #NoTrayIcon ;Create GUI $cs1_w = GUICreate("", 132, 43, -1, -1, BitOR($WS_POPUP, $WS_VISIBLE), $WS_EX_TOOLWINDOW) $i_up = GUICtrlCreatePic(@ScriptDir & "\images\skin\up_cs1.gif", 0, 0, 0, 0, -1, $GUI_WS_EX_PARENTDRAG) $i_map = GUICtrlCreatePic(@ScriptDir & "\images\maps\cs\de_nuke.gif", 101, 12, 30, 30) $i_main = GUICtrlCreatePic(@ScriptDir & "\images\skin\form_main.gif", 0, 11, 0, 0) $cs1_w_l1 = GUICtrlCreateLabel("Players: 14/31", 4, 14, 96) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $cs1_w_l2 = GUICtrlCreateLabel("Map: de_nuke", 4, 26, 96) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState(@SW_SHOW) WinSetOnTop($cs1_w, "", 1) ;Movement Func left() $winpos = WinGetPos($cs1_w) WinMove($cs1_w,"",$winpos[0]-10,$winpos[1]) EndFunc Func right() $winpos = WinGetPos($cs1_w) WinMove($cs1_w,"",$winpos[0]+10,$winpos[1]) EndFunc Func up() $winpos = WinGetPos($cs1_w) WinMove($cs1_w,"",$winpos[0],$winpos[1]-10) EndFunc Func down() $winpos = WinGetPos($cs1_w) WinMove($cs1_w,"",$winpos[0],$winpos[1]+10) EndFunc ;Save Position Func savepos() $winpos = WinGetPos($cs1_w) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\spmon", "cs1_w_x_pos", "REG_SZ", $winpos[0]) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\spmon", "cs1_w_y_pos", "REG_SZ", $winpos[1]) EndFunc While 1 If WinActive($cs1_w) Then HotKeySet("{LEFT}", "left") HotKeySet("{RIGHT}", "right") HotKeySet("{UP}", "up") HotKeySet("{DOWN}", "down") Else HotKeySet("{LEFT}") HotKeySet("{RIGHT}") HotKeySet("{UP}") HotKeySet("{DOWN}") EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE savepos() Exit EndSwitch WEndAnd now i want to create button on my GUI... ok, create image for my button:This image a NOT transparent (.gif):Ok, add my button in GUI after 6 line in code:$i_b_1 = GUICtrlCreatePic(@ScriptDir & "\images\skin\b_1.gif", 123, 3, 0, 0)Added, and now i see this:But if to cut 8 line:;$i_up = GUICtrlCreatePic(@ScriptDir & "\images\skin\up_cs1.gif", 0, 0, 0, 0, -1, $GUI_WS_EX_PARENTDRAG)I see this:Why is my button transparent? Image for button NOT transparent...Project in attach... Please help and sorry for my bad English...help.rar Edited May 12, 2009 by Phantomasss Link to comment Share on other sites More sharing options...
martin Posted May 12, 2009 Share Posted May 12, 2009 Hello, ok, i create a my gui, code: expandcollapse popup#include <WindowsConstants.au3> #include <GUIConstants.au3> #NoTrayIcon ;Create GUI $cs1_w = GUICreate("", 132, 43, -1, -1, BitOR($WS_POPUP, $WS_VISIBLE), $WS_EX_TOOLWINDOW) $i_up = GUICtrlCreatePic(@ScriptDir & "\images\skin\up_cs1.gif", 0, 0, 0, 0, -1, $GUI_WS_EX_PARENTDRAG) $i_map = GUICtrlCreatePic(@ScriptDir & "\images\maps\cs\de_nuke.gif", 101, 12, 30, 30) $i_main = GUICtrlCreatePic(@ScriptDir & "\images\skin\form_main.gif", 0, 11, 0, 0) $cs1_w_l1 = GUICtrlCreateLabel("Players: 14/31", 4, 14, 96) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $cs1_w_l2 = GUICtrlCreateLabel("Map: de_nuke", 4, 26, 96) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState(@SW_SHOW) WinSetOnTop($cs1_w, "", 1) ;Movement Func left() $winpos = WinGetPos($cs1_w) WinMove($cs1_w,"",$winpos[0]-10,$winpos[1]) EndFunc Func right() $winpos = WinGetPos($cs1_w) WinMove($cs1_w,"",$winpos[0]+10,$winpos[1]) EndFunc Func up() $winpos = WinGetPos($cs1_w) WinMove($cs1_w,"",$winpos[0],$winpos[1]-10) EndFunc Func down() $winpos = WinGetPos($cs1_w) WinMove($cs1_w,"",$winpos[0],$winpos[1]+10) EndFunc ;Save Position Func savepos() $winpos = WinGetPos($cs1_w) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\spmon", "cs1_w_x_pos", "REG_SZ", $winpos[0]) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\spmon", "cs1_w_y_pos", "REG_SZ", $winpos[1]) EndFunc While 1 If WinActive($cs1_w) Then HotKeySet("{LEFT}", "left") HotKeySet("{RIGHT}", "right") HotKeySet("{UP}", "up") HotKeySet("{DOWN}", "down") Else HotKeySet("{LEFT}") HotKeySet("{RIGHT}") HotKeySet("{UP}") HotKeySet("{DOWN}") EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE savepos() Exit EndSwitch WEnd And now i want to create button on my GUI... ok, create image for my button: This image a NOT transparent (.gif): Ok, add my button in GUI after 6 line in code: $i_b_1 = GUICtrlCreatePic(@ScriptDir & "\images\skin\b_1.gif", 123, 3, 0, 0) Added, and now i see this: But if to cut 8 line: ;$i_up = GUICtrlCreatePic(@ScriptDir & "\images\skin\up_cs1.gif", 0, 0, 0, 0, -1, $GUI_WS_EX_PARENTDRAG) I see this: Why is my button transparent? Image for button NOT transparent... Project in attach... Please help and sorry for my bad English...I don't know why, it does seem a bit strange. I edited the image and replaced the centre colours with the same colours (as far as I could tell) and saved it. Now it works ok. 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. Link to comment Share on other sites More sharing options...
Phantomasss Posted May 13, 2009 Author Share Posted May 13, 2009 Ok, thanks. It indeed works... Necessary to paint out all of empty cells in a palette of image: http://img144.imageshack.us/img144/2038/pal.gif.That an image was transparent it is necessary to put the color of transparency the last in a cell.Iit is heavy in AutoIt3 . To create transparent .gif for a web pages easier . Link to comment Share on other sites More sharing options...
Phantomasss Posted May 14, 2009 Author Share Posted May 14, 2009 Oh, new problem...I added the button... and now from that it situated on a back image it can be wiped:It can be fixed if create hole in back image:Does not this choise suit, can there are other ideas? Link to comment Share on other sites More sharing options...
Phantomasss Posted May 14, 2009 Author Share Posted May 14, 2009 Maybe this last problem in this GUI:How to add transparent button? As i understand it is necessary to create new GUI:GUICreate("", 6, 6, $cs1_w_x_pos, $cs1_w_y_pos, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $cs1_w)If i add this then all GUI paintet:Why?Image of button:Thanks! Link to comment Share on other sites More sharing options...
Phantomasss Posted May 16, 2009 Author Share Posted May 16, 2009 Help please... Link to comment Share on other sites More sharing options...
martin Posted May 16, 2009 Share Posted May 16, 2009 Help please...Can you post some code which we can run and which shows the problem?Maybe if you set the style of the back image to have $WS_CLIPSIBLINGS and you create the back image after the button image it will fix it. 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. Link to comment Share on other sites More sharing options...
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