MrCreatoR Posted October 18, 2007 Posted October 18, 2007 Hi all, Is it possible to make that the control (in my case it is a picture control) will be partialy/full transparent? i would like to make some fading effect with the picture (like fading slideshows)... I searched on the forum, but it seems that there is no solution on that one Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Nahuel Posted October 19, 2007 Posted October 19, 2007 That would be a nice feature.. setting a control's transparency. I made this with GUIEnhace. It's rough, kinda flickers and can't be applied to some controls (like buttons). #include <GUIEnhance.au3> #include <GUIConstants.au3> $Form1 = GUICreate("Form1", 319, 281, 195, 160) GUISetBkColor(0xC0C0C0) $Edit1 = GUICtrlCreateEdit("", 50, 26, 213, 183, $ES_WANTRETURN, 0) GUICtrlSetBkColor(-1,0xC0C0C0) $Button1 = GUICtrlCreateButton("Button1", 70, 226, 173, 37, $BS_DEFPUSHBUTTON) GUISetState(@SW_SHOW) ControlFocus($Form1,"",$Button1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _GUIEnhanceCtrlFade($Edit1,1000,False,True,0xC0C0C0,0xFFFFFF) GUICtrlSetStyle($Edit1,-1,$WS_EX_CLIENTEDGE) EndSwitch WEnd
MrCreatoR Posted October 19, 2007 Author Posted October 19, 2007 Thanks Nahuel, but i am looking for fading pic control, and it seems that the GUIEnhance can not deal with it...After few hours of trying/testing, i finaly came up with some solution!Here it is:Demo 1expandcollapse popup#include <GUIConstants.au3> Global Const $WM_MOVE = 0x0003 Global Const $WM_ACTIVATE = 0x0006 Global $IsShown = False Global $Img_Path = @Systemdir & "\oobe\images\mslogo.jpg" $GUI = GUICreate("Fading image Demo 1!", 500, 250, -1, -1, -1, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW) GUIRegisterMsg($WM_MOVE, "WM_MOVE") $Button = GUICtrlCreateButton("Show", 20, 200) $Pic_Ctrl = GUICtrlCreatePic($Img_Path, 100, 30, 360, 180, -1, $WS_EX_DLGMODALFRAME) GUICtrlSetState($Pic_Ctrl, $GUI_HIDE) $Child_Gui = GUICreate("Child", 380, 200, -1, -1, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_DLGMODALFRAME, $GUI) WM_MOVE($GUI) GUISetState(@SW_SHOW, $Child_Gui) GUISetState(@SW_SHOW, $GUI) GUICtrlSetState($Pic_Ctrl, $GUI_SHOW) GUIRegisterMsg($WM_ACTIVATE, "WM_ACTIVATE") While 1 Switch GUIGetMsg() Case -3 GUIDelete($GUI) GUIDelete($Child_Gui) Exit Case $Button Local $For = 255, $To = 0, $Step = -2 Local $Button_Data = "Hide" If Not $IsShown Then $IsShown = True Else Local $For = 0, $To = 255, $Step = 2 $Button_Data = "Show" $IsShown = False EndIf For $i = $For To $To Step $Step WinSetTrans($Child_Gui, "", $i) Sleep(1) Next GUICtrlSetData($Button, $Button_Data) EndSwitch WEnd Func WM_MOVE($hWndGUI) If $hWndGUI <> $GUI Then Return $GUI_RUNDEFMSG Local $ParentPosArr = WinGetPos($hWndGUI) WinMove($Child_Gui, "", $ParentPosArr[0]+90, $ParentPosArr[1]+40) EndFunc Func WM_ACTIVATE($hWndGUI) If $hWndGUI = $Child_Gui Then WinActivate($GUI) EndFuncoÝ÷ Ù°Þ¿m«¢+Ø¥¹±Õ±ÐíU% ½¹ÍѹÑ̹ÔÌÐì()±½° ½¹ÍÐÀÌØí]5}5=YôÁàÀÀÀÌ)±½° ½¹ÍÐÀÌØí]5} Q%YQôÁàÀÀÀØ()±½°ÀÌØí%µ|Å}AÑ ôMåÍѵ¥ÈµÀìÅÕ½ÐìÀäÈí½½ÀäÈí¥µÌÀäÈíµÍ±½¼¹©ÁÅÕ½Ðì)±½°ÀÌØí%µ|É}AÑ ôMåÍѵ¥ÈµÀìÅÕ½ÐìÀäÈí½½ÀäÈí¥µÌÀäÈíµ½¹¥Ñ½È¹¥ÅÕ½Ðì(((ÀÌØíU$ôU% ÉÑ ÅÕ½Ðí¥¹¥µµ¼ÈÌÌìÅÕ½Ðì°ÔÀÀ°ÈÔÀ°´Ä°´Ä°´Ä°ÀÌØí]M}a}Q=A5=MP¬ÀÌØí]M}a}Q==1]%9=¤)U%I¥ÍÑÉ5Í ÀÌØí]5}5=Y°ÅÕ½Ðí]5}5=YÅÕ½Ðì¤((ÀÌØí ÕÑѽ¸ôU% Ñɱ ÉÑ ÕÑѽ¸ ÅÕ½ÐíM¡½ÜÅÕ½Ðì°ÈÀ°ÈÀÀ¤(ÀÌØíA¥|Å} ÑÉ°ôU% Ñɱ ÉÑA¥ ÀÌØí%µ|Å}AÑ °ÄÀÀ°ÌÀ°ÌØÀ°ÄàÀ°´Ä°ÀÌØí]M}a}15=1I5¤)U% ÑɱMÑMÑÑ ÀÌØíA¥|Å} ÑÉ°°ÀÌØíU%}!%¤(ÀÌØíA¥|É} ÑÉ°ôU% Ñɱ ÉÑA¥ ÀÌØí%µ|É}AÑ °ÄÀÀ°ÌÀ°ÌØÀ°ÄàÀ°´Ä°ÀÌØí]M}a}15=1I5¤)U% ÑɱMÑMÑÑ ÀÌØíA¥|É} ÑÉ°°ÀÌØíU%}!%¤((ÀÌØí ¡¥±}Õ¤ôU% ÉÑ ÅÕ½Ðí ¡¥±ÅÕ½Ðì°ÌàÀ°ÈÀÀ°´Ä°´Ä°ÀÌØí]M}A=AU@°ÀÌØí]M}a}Q=A5=MP¬ÀÌØí]M}a}15=1I5°ÀÌØíU$¤()]5}5=Y ÀÌØíU$¤()U%MÑMÑÑ¡M]}M!=°ÀÌØí ¡¥±}Õ¤¤)U%MÑMÑÑ¡M]}M!=°ÀÌØíU$¤()U%I¥ÍÑÉ5Í ÀÌØí]5} Q%YQ°ÅÕ½Ðí]5} Q%YQÅÕ½Ðì¤()]¡¥±Ä(%MÝ¥Ñ U%Ñ5Í ¤($% Í´Ì($$%á¥Ð($% ÍÀÌØí ÕÑѽ¸($$%U% ÑɱMÑMÑÑ ÀÌØíA¥|Å} ÑÉ°°ÀÌØíU%}M!=¤($$$($$%½ÈÀÌØí¤ôÈÔÀQ¼ÔÀMÑÀ´È($$$%]¥¹MÑQÉ¹Ì ÀÌØí ¡¥±}Õ¤°ÅÕ½ÐìÅÕ½Ðì°ÀÌØí¤¤($$$%M±À Ĥ($$%9áÐ($$$($$%½ÈÀÌØí¤ôÔÀQ¼ÈÔÀMÑÀÈ($$$%]¥¹MÑQÉ¹Ì ÀÌØí ¡¥±}Õ¤°ÅÕ½ÐìÅÕ½Ðì°ÀÌØí¤¤($$$%M±À Ĥ($$%9áÐ($$$($$%U% ÑɱMÑMÑÑ ÀÌØíA¥|Å} ÑÉ°°ÀÌØíU%}!%¤($$%M±À ÄÀÀÀ¤($$%U% ÑɱMÑMÑÑ ÀÌØíA¥|É} ÑÉ°°ÀÌØíU%}M!=¤($$$($$$($$%½ÈÀÌØí¤ôÈÔÀQ¼ÔÀMÑÀ´È($$$%]¥¹MÑQÉ¹Ì ÀÌØí ¡¥±}Õ¤°ÅÕ½ÐìÅÕ½Ðì°ÀÌØí¤¤($$$%M±À Ĥ($$%9áÐ($$$($$%½ÈÀÌØí¤ôÔÀQ¼ÈÔÀMÑÀÈ($$$%]¥¹MÑQÉ¹Ì ÀÌØí ¡¥±}Õ¤°ÅÕ½ÐìÅÕ½Ðì°ÀÌØí¤¤($$$%M±À Ĥ($$%9áÐ($$$($$%U% ÑɱMÑMÑÑ ÀÌØíA¥|Å} ÑÉ°°ÀÌØíU%}!%¤($$%U% ÑɱMÑMÑÑ ÀÌØíA¥|É} ÑÉ°°ÀÌØíU%}!%¤(%¹MÝ¥Ñ )]¹()Õ¹]5}5=Y ÀÌØí¡]¹U$¤(%ÀÌØí¡]¹U$±ÐìÐìÀÌØíU$Q¡¸IÑÕɸÀÌØíU%}IU95M(%1½°ÀÌØíAɹÑA½ÍÉÈô]¥¹ÑA½Ì ÀÌØí¡]¹U$¤(%]¥¹5½Ù ÀÌØí ¡¥±}Õ¤°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíAɹÑA½ÍÉÉlÁt¬äÀ°ÀÌØíAɹÑA½ÍÉÉlÅt¬ÐÀ¤)¹Õ¹()Õ¹]5} Q%YQ ÀÌØí¡]¹U$¤(%%ÀÌØí¡]¹U$ôÀÌØí ¡¥±}Õ¤Q¡¸]¥¹Ñ¥ÙÑ ÀÌØíU$¤)¹Õ¹ Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Moderators SmOke_N Posted October 19, 2007 Moderators Posted October 19, 2007 Might look at: $WS_EX_MDICHILD rather than your wm_move function. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
MrCreatoR Posted October 19, 2007 Author Posted October 19, 2007 I looked at it, thanks, but i can not make it to work, the child gui is like splashing over the parent gui when you move it. And also, i do have other method to make this move (using DllCalls), but then WinSetTrans wont work on the child). Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Valuater Posted October 19, 2007 Posted October 19, 2007 (edited) Another idea expandcollapse popup#include <GUIConstants.au3> ; these two are not needed with beta ;Global Const $WM_MOVE = 0x0003 ;Global Const $WM_ACTIVATE = 0x0006 Global $Img_1_Path = @Systemdir & "\oobe\images\mslogo.jpg" Global $Img_2_Path = @Systemdir & "\oobe\images\monitor.gif" Global $pic[3] $GUI = GUICreate("Fading image Demo 2!", 500, 250, -1, -1, -1, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW) $Button = GUICtrlCreateButton("Show", 20, 200) $Child_Gui = GUICreate("Child", 360, 180, -1, -1, $WS_POPUP, $WS_EX_TOPMOST, $GUI) $Pic[1] = GUICtrlCreatePic($Img_1_Path, 0, 0, 360, 180);, -1, $WS_EX_DLGMODALFRAME) GUICtrlSetState($Pic[1], $GUI_HIDE) $Pic[2] = GUICtrlCreatePic($Img_2_Path, 0, 0, 360, 180);, -1, $WS_EX_DLGMODALFRAME) GUICtrlSetState($Pic[2], $GUI_HIDE) GUISetState(@SW_SHOW, $GUI) XSkinAnimate($Child_Gui, 2) While 1 Switch GUIGetMsg() Case -3 Exit Case $Button GUICtrlSetState($Pic[1], $GUI_SHOW) XSkinAnimate($Child_Gui, "", 1) XSkinAnimate($Child_Gui, "", 2) GUICtrlSetState($Pic[1], $GUI_HIDE) GUICtrlSetState($Pic[2], $GUI_SHOW) XSkinAnimate($Child_Gui, "", 1) XSkinAnimate($Child_Gui, "", 2) GUICtrlSetState($Pic[1], $GUI_HIDE) GUICtrlSetState($Pic[2], $GUI_HIDE) $t = 2 for $x = 1 to 19 step 2 If $t = 2 then GUICtrlSetState($Pic[$t], $GUI_SHOW) GUICtrlSetState($Pic[$t-1], $GUI_HIDE) XSkinAnimate($Child_Gui, "", $x) $t =1 Else GUICtrlSetState($Pic[$t+1], $GUI_HIDE) GUICtrlSetState($Pic[$t], $GUI_SHOW) XSkinAnimate($Child_Gui, "", $x) $t = 2 EndIf Sleep(1000) XSkinAnimate($Child_Gui, "", $x +1) Sleep(1000) Next EndSwitch WEnd Func XSkinAnimate($Xwnd, $Xstate = 1, $Xstyle = 0, $Xtrans = 0, $Xspeed = 1500) ; $Xstate - 1 = Show, 2 = Hide, "" = No State Set ; $Xstyle - 1=Fade, 3=Explode, 5=L-Slide, 7=R-Slide, 9=T-Slide, 11=B-Slide, 13=TL-Diag-Slide, 15=TR-Diag-Slide, 17=BL-Diag-Slide, 19=BR-Diag-Slide Local $Xpick = StringSplit('80000,90000,40010,50010,40001,50002,40002,50001,40004,50008,40008,50004,40005,5000a,40006,50009,4000 9,50006,4000a,50005', ",") If Not WinExists($Xwnd) Then XSkinAnError("XSkinAnimate, $Xwnd - Window not found ") If $Xstyle > $Xpick[0] Then XSkinAnError("XSkinAnimate, $Xstyle max is 19 ") If $Xstyle <> 0 Then Local $ret = DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Xwnd, "int", $Xspeed, "long", "0x000" & $Xpick[$Xstyle]) If $Xtrans <> 0 Then WinSetTrans($Xwnd, "", $Xtrans) If $Xstate = 1 Then GUISetState(@SW_SHOW, $Xwnd) If $Xstate = 2 Then GUISetState(@SW_HIDE, $Xwnd) If $Xstyle <> 0 Then Return $ret EndFunc ;==>XSkinAnimate Func XSkinAnError($XE_msg) MsgBox(262208, "XSkin Error", $XE_msg, 5) Exit EndFunc ;==>XSkinAnError 8) ******* EDIT: Just noticed it loses the "Child" position, you can move the main window and the child window remains .... ah, just an effort, hope it can help somehow!!!/... 8) Edited October 19, 2007 by Valuater
MrCreatoR Posted October 19, 2007 Author Posted October 19, 2007 Nice, Thanks you Valuater Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
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