Jump to content

Splash with fade-in


Recommended Posts

hi guys,

i'm quite new to autoit and i tried creating some gui's with a splash-image.

i wanted to have a splash with fade in and fade out and my problem is that:

if i start my script the splash blinks once without any transparency and then everything works fine.

can anyone improve it?

SplashImageOn("Splash", "splash.gif", 341, 425, @DesktopWidth/2-341/2, @DesktopHeight/2-425/2, 1)
WinSetTrans("Splash","",0)


For $trans=0 to 255
    WinSetTrans("Splash","",$trans)
    $trans+=1
    Sleep(10)
Next
Sleep(500)

For $trans=255 to 0 Step -1
    $trans-=1
    WinSetTrans("Splash","",$trans)
    Sleep(10)
Next

SplashOff()

thanks

Link to comment
Share on other sites

hi guys,

i'm quite new to autoit and i tried creating some gui's with a splash-image.

i wanted to have a splash with fade in and fade out and my problem is that:

if i start my script the splash blinks once without any transparency and then everything works fine.

can anyone improve it?

SplashImageOn("Splash", "splash.gif", 341, 425, @DesktopWidth/2-341/2, @DesktopHeight/2-425/2, 1)
WinSetTrans("Splash","",0)


For $trans=0 to 255
    WinSetTrans("Splash","",$trans)
    $trans+=1
    Sleep(10)
Next
Sleep(500)

For $trans=255 to 0 Step -1
    $trans-=1
    WinSetTrans("Splash","",$trans)
    Sleep(10)
Next

SplashOff()

thanks

I think it is best to keep away from the extreme values 0 and 255. It might be only one of them that's a problem, you ll need to experiment.

Also, the splash screen is initially created without transparency so you will get a flicker anyway, but the version below will make it look ok.

SplashImageOn("Splash", "splash.gif", 341, 425, @DesktopWidth, @DesktopHeight, 1)

WinSetTrans("Splash","",1)
WinMove("Splash","", @DesktopWidth/2-341/2, @DesktopHeight/2-425/2)

For $trans=0 to 255
    WinSetTrans("Splash","",$trans)
    $trans+=1
    Sleep(10)
Next
Sleep(500)

For $trans=255 to 0 Step -1
    $trans-=1
    WinSetTrans("Splash","",$trans)
    Sleep(10)
Next

SplashOff()

EDIT AGAIN: Tried it with 0 and 255 and works ok so maybe it's IE which has the problem with one of those values, I obviously forget. But as Siao says in next post, might be better not to use SplashOn.

Edited by martin
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

SplashImageOn("Splash", "splash.gif", 341, 425, @DesktopWidth, @DesktopHeight, 1)

WinSetTrans("Splash","",1)
WinMove("Splash","", @DesktopWidth/2-341/2, @DesktopHeight/2-425/2)

For $trans=0 to 255
    WinSetTrans("Splash","",$trans)
    $trans+=1
    Sleep(10)
Next
Sleep(500)

For $trans=255 to 0 Step -1
    $trans-=1
    WinSetTrans("Splash","",$trans)
    Sleep(10)
Next

SplashOff()

looks good. thank you

Link to comment
Share on other sites

Use GuiCreate+GuiCtrlCreatePic so you can start hidden.

I agree with you

example

#include <GUICONSTANTS.AU3>

$splash_gui = GUICreate ("", 400, 300,-1,-1,$WS_POPUP)
GUICtrlCreatePic (@SystemDir & "\setup.bmp",0,0,400,300)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $splash_gui, "int", 1000, "long", 0x00080000);fade-in
Sleep (2000)
Exit

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

I agree with you

example

#include <GUICONSTANTS.AU3>

$splash_gui = GUICreate ("", 400, 300,-1,-1,$WS_POPUP)
GUICtrlCreatePic (@SystemDir & "\setup.bmp",0,0,400,300)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $splash_gui, "int", 1000, "long", 0x00080000);fade-in
Sleep (2000)
Exit
Question about the DLLCall - the MSDN documentation said to use dwords and whatnot - you can change the type? and how did you get your values for the int and long values?

Thanks.

-Monkey

Monkeh.

Link to comment
Share on other sites

this demo might help here!!!...???

; Demo
;#cs
#include <GUIConstants.au3>
Dim $repeat = 1
$hwnd = GUICreate("XSkin Animate", 300, 300)

$ret = XSkinAnimate($hwnd, 1, $repeat)
Sleep(2000)

While $repeat <= 28 ;*********** will error - for testing only
    $repeat += 1
    XSkinAnimate($hwnd, "", $repeat)
   
    Sleep(1000)
   
    $repeat += 1
    XSkinAnimate($hwnd, "", $repeat)
    Sleep(1000)
WEnd
;#ce



Func XSkinAnimate($Xwnd, $Xstate = 1, $Xstyle = 0, $Xtrans = 0, $Xspeed = 1000)
    ; $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,40009,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)

NEWHeader1.png

Link to comment
Share on other sites

check this example from the (==> Welcome to AutoIt 1-2-3 <== A ) lessons

the post is by our Valuater

;Animate Display *nice* addition
; Author Raindancer

$hwnd = GUICreate("Animate Window", 300, 200)
GUICtrlCreateLabel("Fantasic... You Have PASSED!!!", 50, 50, 200, 50)
GUICtrlSetFont( -1, 16, 800)

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00080000);fade-in
GUISetState()
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00090000);fade-out
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040001);slide in from left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050002);slide out to left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040002);slide in from right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050001);slide out to right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040004);slide-in from top
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050008);slide-out to top
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040008);slide-in from bottom
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050004);slide-out to bottom
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040005);diag slide-in from Top-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0005000a);diag slide-out to Top-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040006);diag slide-in from Top-Right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050009);diag slide-out to Top-Right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040009);diag slide-in from Bottom-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050006);diag slide-out to Bottom-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0004000a);diag slide-in from Bottom-right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050005);diag slide-out to Bottom-right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040010);explode
Sleep(1000)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050010);implode

#define AW_HOR_POSITIVE            0x00000001
#define AW_HOR_NEGATIVE            0x00000002
#define AW_VER_POSITIVE            0x00000004
#define AW_VER_NEGATIVE            0x00000008
#define AW_CENTER                  0x00000010
#define AW_HIDE                    0x00010000
#define AW_ACTIVATE                0x00020000
#define AW_SLIDE                    0x00040000
#define AW_BLEND                    0x00080000

this helped me a lot in making simple window animation

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...