Sign in to follow this  
Followers 0
Innovative

SplashImageOn animations

7 posts in this topic

SplashImageOn displays a image immediately but is it possible to make it fade ?

Fade in or out with the image ..

Share this post


Link to post
Share on other sites



Only way I could come up to do it is using a .gif image to have the animation of fading in/out or planting a .avi in a form and have it load or unload.

Share this post


Link to post
Share on other sites

Could create your own... :)

This is a rough example...

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>

Global $GUI, $hGraphic, $hImage
$file = FileOpenDialog("", "", "All (*.*)")
$ret = _SplashScreenCreateEx($file)
Sleep(5000)
_SplashScreenDeleteEx($ret)

Func _SplashScreenCreateEx($imagefile, $width = -1, $height = -1)
    Local $aRet[3]
    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile($imagefile)
    If $width = -1 Then
        $width = _GDIPlus_ImageGetWidth($hImage)
    EndIf
    If $height = -1 Then
        $height = _GDIPlus_ImageGetHeight($hImage)
    EndIf
    $GUI = GUICreate("AutoIt Splash Screen Example", $width, $height, Default, Default, $WS_POPUP)
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($GUI)
    GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT")
    GUISetState()
    For $i = 0 to 55 Step 1
        WinSetTrans($GUI, "", $i)
    Next
    $aRet[0] = $GUI
    $aRet[1] = $hGraphic
    $aRet[2] = $hImage
    Return $aRet
EndFunc  ;==>_SplashScreenCreateEx

Func _SplashScreenDeleteEx($hwnd)
    For $i = 255 to 0 Step -1
        WinSetTrans($hwnd[0], "", $i)
    Next
    _GDIPlus_GraphicsDispose($hwnd[1])
    _GDIPlus_ImageDispose($hwnd[2])
    _GDIPlus_Shutdown()
    GUIDelete($hwnd[0])
EndFunc  ;==>_SplashScreenDeleteEx

Func MY_WM_PAINT($hwnd, $Msg, $wParam, $lParam)
    _WinAPI_RedrawWindow($GUI, 0, 0, $RDW_UPDATENOW)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)
    _WinAPI_RedrawWindow($GUI, 0, 0, $RDW_VALIDATE)
    Return $GUI_RUNDEFMSG
EndFunc  ;==>MY_WM_PAINT

Also check this out: #172805

Different way to do the animation...

Hope that gives you a starting point.

Cheers,

Brett

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@BrettF

I tried that but thats what happen with an full image

It only displayed the corner of the picture .. It do fades btw.

Posted Image

Edited by xVivoCity

Share this post


Link to post
Share on other sites

@xVivoCity

??

#include <WindowsConstants.au3>
$pic = FileOpenDialog("Select picture to display", "", "All Picture (*.*)", 1 + 2)

$hwnd = GUICreate("", @DesktopWidth - 300, @DesktopHeight - 300, -1, -1, $WS_POPUP)
GUICtrlCreatePic($pic, 0, 0, @DesktopWidth - 300, @DesktopHeight - 300)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00080000);fade-in
GUISetState()
Sleep(2000);View picture
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00090000);fade-out
Exit

While 1
    Sleep(250)
WEnd

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Thanks FireFox ! Worked , however, .gif files don't animate is it possible to make it animate ?

Share this post


Link to post
Share on other sites

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0