Jump to content

SplashImageOn animations


Recommended Posts

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

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