pintas Posted January 22, 2009 Share Posted January 22, 2009 (edited) I'm trying to fade a window but i ran into some problems. I tried using WinAnimate.au3 but it flickers, because i want the window to have a particular transparency value. So the fade in effect goes to transparency value 255 and then back. I also tried this? For $TRANSCOUNT = 0 To 220 Step - 10 WinSetTrans($2gui, "", $TRANSCOUNT) Sleep(15) Next But nothing happens... How can i do this right? Edited January 22, 2009 by pintas Link to comment Share on other sites More sharing options...
KJohn Posted January 22, 2009 Share Posted January 22, 2009 I'm trying to fade a window but i ran into some problems. I tried using WinAnimate.au3 but it flickers, because i want the window to have a particular transparency value. So the fade in effect goes to transparency value 255 and then back. I also tried this? For $TRANSCOUNT = 0 To 220 Step - 10 WinSetTrans($2gui, "", $TRANSCOUNT) Sleep(15) Next But nothing happens... How can i do this right? DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $handle, "int", 140, "long", 0x00080000) just before GUISetState()... $handle is the handle returned by GUICreate and in this example, 140 is the time in millisecs for the fade in to occur (smaller for faster fade ins). Use WinSetTrans to set the desired transparency after GUISetState()... Link to comment Share on other sites More sharing options...
pintas Posted January 22, 2009 Author Share Posted January 22, 2009 Thanks for your reply, but the flicker occurs as well. Its not a smooth transition. I'm trying to use a very small transparency value, something like 100, and that way the fade goes from 0 to 255 and then back to 100, it doesn't look very good. Any other way? Link to comment Share on other sites More sharing options...
KJohn Posted January 22, 2009 Share Posted January 22, 2009 (edited) Thanks for your reply, but the flicker occurs as well. Its not a smooth transition.I'm trying to use a very small transparency value, something like 100, and that way the fade goes from 0 to 255 and then back to 100, it doesn't look very good.Any other way?Back to square one then.. The for loop method is your best bet then. The reason why nothing happened is:For $TRANSCOUNT = 0 To 220 Step - 10 WinSetTrans($2gui, "", $TRANSCOUNT) Sleep(15)NextA For loop will execute zero times if: start > stop and step > 0, or start < stop and step is negativeSo nothing in your for loop actually ever executed. Edited January 22, 2009 by Koshy John Link to comment Share on other sites More sharing options...
pintas Posted January 22, 2009 Author Share Posted January 22, 2009 (edited) That's because i'm too much of a n00b! I was trying this for the fade out, i thought the reversed values would do the opposite. For $TRANSCOUNT = 254 To 0 Step - 10 WinSetTrans($2gui, "", $TRANSCOUNT) Sleep(15) Next So i reversed the values to see if it worked. But how can i fix that? Edited January 22, 2009 by pintas Link to comment Share on other sites More sharing options...
KJohn Posted January 23, 2009 Share Posted January 23, 2009 That's because i'm too much of a n00b! I was trying this for the fade out, i thought the reversed values would do the opposite. For $TRANSCOUNT = 254 To 0 Step - 10 WinSetTrans($2gui, "", $TRANSCOUNT) Sleep(15) Next So i reversed the values to see if it worked. But how can i fix that?For $TRANSCOUNT = 0 To 255 Step 10 WinSetTrans($2gui, "", $TRANSCOUNT) Sleep(15) Next I hope that answers your question... Link to comment Share on other sites More sharing options...
billthecreator Posted January 24, 2009 Share Posted January 24, 2009 Try Here [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap 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