#Region ;************ Includes ************ #include #include #include #EndRegion ;************ Includes ************ HotKeySet ( '{ESC}', '_Exit' ) OnAutoItExitRegister ( '_Exit' ) Global $hGui, $sGuiTitle = 'AnimatedSplashs' Global $hImage1, $iWidth, $iHeight, $iRatio, $iLastWidth, $iLastHeight ; create a 2d array with urls and file names. Global $aArray[24][2] = [ _ [ 'http://s29.postimg.org/m0142axif/20141102153541.png', 'AWorldofKefling2.png' ], _ [ 'http://s13.postimg.org/eq6rnv0rb/20141102153624.png', 'Sonic1.png' ], _ [ 'http://s4.postimg.org/3r8mkcfot/20141102153655.png', 'Garfield1.png' ], _ [ 'http://s10.postimg.org/c1ijfx2ih/20141102153742.png', 'Pokemon1.png' ], _ [ 'http://s28.postimg.org/bv1136331/20141102153819.png', 'TutanchamunMask2.png' ], _ [ 'http://s14.postimg.org/e8qgkro8h/20141102153843.png', 'Skype1.png' ], _ [ 'http://s7.postimg.org/i9poeggej/20141102153903.png', 'Ubuntu1.png' ], _ [ 'http://s29.postimg.org/p6ic02uqv/20141102153924.png', 'Iphone1.png' ], _ [ 'http://s16.postimg.org/euhmobxf9/20141102153947.png', 'DonkeyKong1.png' ], _ [ 'http://s21.postimg.org/m4knhft3r/20141102154009.png', 'ChanelNo5_1.png' ], _ [ 'http://s28.postimg.org/adorj3d3x/20141102154030.png', 'PirateBay1.png' ], _ [ 'http://s9.postimg.org/f3hvbhjyn/20141102154056.png', 'Mario2.png' ], _ [ 'http://s28.postimg.org/5hpq552cd/20141102154118.png', 'Safari1.png' ], _ [ 'http://s21.postimg.org/p3rk4k2l3/20141102154140.png', 'Ring1.png' ], _ [ 'http://s15.postimg.org/rgvy6en63/20141102154159.png', 'Lexus1.png' ], _ [ 'http://s27.postimg.org/gmv1hqrkz/20141102154239.png', 'Mario&Yoshi1.png' ], _ [ 'http://s9.postimg.org/6kcq2bwpb/20141102154256.png', 'Firefox1.png' ], _ [ 'http://s18.postimg.org/6115mdn6x/20141102154323.png', 'Shaun2.png' ], _ [ 'http://s29.postimg.org/g5czdybl3/20141102154344.png', 'GranTurismo1.png' ], _ [ 'http://s30.postimg.org/44mppue29/20141102154406.png', 'Diddy1.png' ], _ [ 'http://s30.postimg.org/8t2pl138x/20141102154426.png', 'TheGimp1.png' ], _ [ 'http://s30.postimg.org/vbisv90vl/20141102154446.png', 'Raiponce1.png' ], _ [ 'http://s28.postimg.org/ahnmwgowt/20141102154501.png', 'Tux1.png' ], _ [ 'http://s17.postimg.org/i98uxtqu7/20141102154515.png', 'Stars4.png' ] _ ] If _FileIsMissing () Then _DownloadPng () If FileExists ( @TempDir & '\Png2\AWorldofKefling2.png' ) Then ToolTip ( ' Example N°01/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashCome ( @TempDir & '\Png2\AWorldofKefling2.png' ) _SplashGoes ( @TempDir & '\Png2\AWorldofKefling2.png' ) EndIf If FileExists ( @TempDir & '\Png2\Sonic1.png' ) Then ToolTip ( ' Example N°02/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashEnlarge ( @TempDir & '\Png2\Sonic1.png', 1 ) Sleep ( 1000 ) _SplashGoes ( @TempDir & '\Png2\Sonic1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Garfield1.png' ) Then ToolTip ( ' Example N°03/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashMove ( @TempDir & '\Png2\Garfield1.png', ( @DesktopWidth-300 )/2, 0, ( @DesktopWidth-300 )/2, @DesktopHeight-225, 5 ) _SplashFade ( @TempDir & '\Png2\Garfield1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Pokemon1.png' ) Then ToolTip ( ' Example N°04/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashEnlarge ( @TempDir & '\Png2\Pokemon1.png', 3 ) _SplashFade ( @TempDir & '\Png2\Pokemon1.png' ) EndIf If FileExists ( @TempDir & '\Png2\TutanchamunMask2.png' ) Then ToolTip ( ' Example N°05/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashCome ( @TempDir & '\Png2\TutanchamunMask2.png' ) _SplashGoes ( @TempDir & '\Png2\TutanchamunMask2.png' ) EndIf If FileExists ( @TempDir & '\Png2\Skype1.png' ) Then ToolTip ( ' Example N°06/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashEnlarge ( @TempDir & '\Png2\Skype1.png', 3 ) _SplashFade ( @TempDir & '\Png2\Skype1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Ubuntu1.png' ) Then ToolTip ( ' Example N°07/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashCome ( @TempDir & '\Png2\Ubuntu1.png' ) _SplashGoes ( @TempDir & '\Png2\Ubuntu1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Iphone1.png' ) Then ToolTip ( ' Example N°08/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashMove ( @TempDir & '\Png2\Iphone1.png', 0, 0, @DesktopWidth-300, @DesktopHeight-237, 5 ) _SplashFade ( @TempDir & '\Png2\Iphone1.png' ) EndIf If FileExists ( @TempDir & '\Png2\DonkeyKong1.png' ) Then ToolTip ( ' Example N°09/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashUnFade ( @TempDir & '\Png2\DonkeyKong1.png' ) _SplashFade ( @TempDir & '\Png2\DonkeyKong1.png' ) EndIf If FileExists ( @TempDir & '\Png2\ChanelNo5_1.png' ) Then ToolTip ( ' Example N°10/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashEnlarge ( @TempDir & '\Png2\ChanelNo5_1.png', 1.5 ) _SplashFade ( @TempDir & '\Png2\ChanelNo5_1.png' ) EndIf If FileExists ( @TempDir & '\Png2\PirateBay1.png' ) Then ToolTip ( ' Example N°11/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashCome ( @TempDir & '\Png2\PirateBay1.png' ) _SplashFade ( @TempDir & '\Png2\PirateBay1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Mario2.png' ) Then ToolTip ( ' Example N°12/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashMove ( @TempDir & '\Png2\Mario2.png', @DesktopWidth-200, @DesktopHeight-250, -50, -80, 5 ) _SplashFade ( @TempDir & '\Png2\Mario2.png' ) EndIf If FileExists ( @TempDir & '\Png2\Safari1.png' ) Then ToolTip ( ' Example N°13/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashCome ( @TempDir & '\Png2\Safari1.png' ) _SplashGoes ( @TempDir & '\Png2\Safari1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Ring1.png' ) Then ToolTip ( ' Example N°14/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashEnlarge ( @TempDir & '\Png2\Ring1.png', 1.5 ) _SplashFade ( @TempDir & '\Png2\Ring1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Lexus1.png' ) Then ToolTip ( ' Example N°15/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashCome ( @TempDir & '\Png2\Lexus1.png' ) _SplashGoes ( @TempDir & '\Png2\Lexus1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Mario&Yoshi1.png' ) Then ToolTip ( ' Example N°16/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashMove ( @TempDir & '\Png2\Mario&Yoshi1.png', -300, @DesktopHeight-200, @DesktopWidth-280, -30, 5 ) _SplashFade ( @TempDir & '\Png2\Mario&Yoshi1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Firefox1.png' ) Then ToolTip ( ' Example N°17/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashCome ( @TempDir & '\Png2\Firefox1.png' ) _SplashFade ( @TempDir & '\Png2\Firefox1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Shaun2.png' ) Then ToolTip ( ' Example N°18/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashMove ( @TempDir & '\Png2\Shaun2.png', @DesktopWidth-199, -100, 0, @DesktopHeight-300, 5 ) _SplashMove ( @TempDir & '\Png2\Shaun2.png', 0, @DesktopHeight-300, @DesktopWidth-199, @DesktopHeight-300, 5 ) _SplashMove ( @TempDir & '\Png2\Shaun2.png', @DesktopWidth-199, @DesktopHeight-300, @DesktopWidth-199, (@DesktopHeight-400)/2, 5 ) _SplashMove ( @TempDir & '\Png2\Shaun2.png', @DesktopWidth-199, (@DesktopHeight-400)/2, (@DesktopWidth-300)/2, (@DesktopHeight-300)/2, 5 ) _SplashFade ( @TempDir & '\Png2\Shaun2.png' ) EndIf If FileExists ( @TempDir & '\Png2\GranTurismo1.png' ) Then ToolTip ( ' Example N°19/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashEnlarge ( @TempDir & '\Png2\GranTurismo1.png', 2 ) _SplashFade ( @TempDir & '\Png2\GranTurismo1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Diddy1.png' ) Then ToolTip ( ' Example N°20/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashCome ( @TempDir & '\Png2\Diddy1.png' ) _SplashGoes ( @TempDir & '\Png2\Diddy1.png' ) EndIf If FileExists ( @TempDir & '\Png2\TheGimp1.png' ) Then ToolTip ( ' Example N°21/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashEnlarge ( @TempDir & '\Png2\TheGimp1.png' ) _SplashFade ( @TempDir & '\Png2\TheGimp1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Raiponce1.png' ) Then ToolTip ( ' Example N°22/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashCome ( @TempDir & '\Png2\Raiponce1.png' ) _SplashGoes ( @TempDir & '\Png2\Raiponce1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Tux1.png' ) Then ToolTip ( ' Example N°23/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashEnlarge ( @TempDir & '\Png2\Tux1.png' ) _SplashFade ( @TempDir & '\Png2\Tux1.png' ) EndIf If FileExists ( @TempDir & '\Png2\Stars4.png' ) Then ToolTip ( ' Example N°24/24' & @Crlf, @DesktopWidth/2-152, 0, $sGuiTitle, 1, 4 ) _SplashCome ( @TempDir & '\Png2\Stars4.png' ) _SplashFade ( @TempDir & '\Png2\Stars4.png' ) EndIf Exit Func _DownloadPng () ToolTip ( 'Please wait some few seconds while downloading png files' & @Crlf, @DesktopWidth/2 -152, 200, $sGuiTitle, 1, 4 ) DirCreate ( @TempDir & '\Png2' ) Local $aInetget[UBound ( $aArray )] ;~ Local $hTimerInit = TimerInit () For $i = 0 To UBound ( $aArray ) -1 If Not FileExists ( @TempDir & '\Png2\' & $aArray[$i][1] ) Then $aInetget[$i] = InetGet ( $aArray[$i][0], @TempDir & '\Png2\' & $aArray[$i][1], 1+8, 1 ) EndIf Next ;~ wait for end of downloads. For $i = 0 To UBound ( $aInetget ) -1 Do Sleep ( 250 ) Until InetGetInfo ( $aInetget[$i], 2 ) InetClose ( $aInetget[$i] ) Next ;~ ConsoleWrite ( @ScriptLineNumber & ' TimerDiff Downloads : ' & TimerDiff ( $hTimerInit ) & @Crlf ) ToolTip ( '' ) EndFunc ;==> _DownloadPng () Func _Exit () ToolTip ( '' ) _ImageDispose ( $hImage1 ) Exit EndFunc ;==> _Exit Func _FileIsMissing () For $i = 0 To UBound ( $aArray ) -1 If Not FileExists ( @TempDir & '\Png2\' & $aArray[$i][1] ) Then Return 1 Next EndFunc ;==> _FileIsMissing () Func _ImageDispose ( $himage ) GUIDelete ( $hGui ) _GDIPlus_GraphicsDispose ( $himage ) _GDIPlus_Shutdown () $hImage1 = 0 $hGui = 0 EndFunc ;==> _ImageDispose () Func _ImageInit ( $sPngPath2 ) _GDIPlus_Startup () $hImage1 = _GDIPlus_ImageLoadFromFile ( $sPngPath2 ) $iWidth = _GDIPlus_ImageGetWidth ( $hImage1 ) $iHeight = _GDIPlus_ImageGetHeight ( $hImage1 ) $iRatio = Round ( $iWidth / $iHeight ) EndFunc ;==> _ImageInit () Func _ImageResize ( $sInImage, $newW, $newH, $sOutImage='' ) Local $oldImage, $GC, $newBmp, $newGC If $sOutImage = '' Then _GDIPlus_Startup () $oldImage = _GDIPlus_ImageLoadFromFile ( $sInImage ) $GC = _GDIPlus_ImageGetGraphicsContext ( $oldImage ) $newBmp = _GDIPlus_BitmapCreateFromGraphics ( $newW, $newH, $GC ) $newGC = _GDIPlus_ImageGetGraphicsContext ( $newBmp ) _GDIPlus_GraphicsDrawImageRect ( $newGC, $oldImage, 0, 0, $newW, $newH ) _GDIPlus_GraphicsDispose ( $GC ) _GDIPlus_GraphicsDispose ( $newGC ) _GDIPlus_ImageDispose ( $oldImage ) If $sOutImage = '' Then Return $newBmp Else _GDIPlus_ImageSaveToFile ( $newBmp, $sOutImage ) _GDIPlus_BitmapDispose ( $newBmp ) _GDIPlus_Shutdown () Return 1 EndIf EndFunc ;==> _ImageResize () Func _SetBitmap ( $hGUI, $hImage, $iOpacity, $n_width, $n_height ) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC ( 0 ) $hMemDC = _WinAPI_CreateCompatibleDC ( $hScrDC ) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap ( $hImage ) $hOld = _WinAPI_SelectObject ( $hMemDC, $hBitmap ) $tSize = DllStructCreate ( $tagSIZE ) $pSize = DllStructGetPtr ( $tSize ) DllStructSetData ( $tSize, 'X', $n_width ) DllStructSetData ( $tSize, 'Y', $n_height ) $tSource = DllStructCreate ( $tagPOINT ) $pSource = DllStructGetPtr ( $tSource ) $tBlend = DllStructCreate ( $tagBLENDFUNCTION ) $pBlend = DllStructGetPtr ( $tBlend ) DllStructSetData ( $tBlend, 'Alpha', $iOpacity ) DllStructSetData ( $tBlend, 'Format', 1 ) _WinAPI_UpdateLayeredWindow ( $hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA ) _WinAPI_ReleaseDC ( 0, $hScrDC ) _WinAPI_SelectObject ( $hMemDC, $hOld ) _WinAPI_DeleteObject ( $hBitmap ) _WinAPI_DeleteDC ( $hMemDC ) EndFunc ;==> _SetBitmap () Func _SplashCome ( $sPngPath ) If Not $hImage1 Then _ImageInit ( $sPngPath ) If Not $hGui Then $hGui = GUICreate ( $sGuiTitle, $iWidth , $iHeight, -1, -1, -1, BitOR ( $WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW ) ) For $iWidth = 50 To @DesktopWidth/4 Step 3 WinMove ( $hGui, '', ( @DesktopWidth - $iWidth )/2, ( @DesktopHeight - $iHeight )/2, $iWidth, $iWidth/$iRatio ) GUISetState ( @SW_SHOW ) $hImage1 = _ImageResize ( $sPngPath, $iWidth, $iWidth/$iRatio ) _SetBitMap ( $hGui, $hImage1, 255, $iWidth, $iWidth/$iRatio ) Sleep ( 10 ) Next _WinGetPos () Sleep ( 1000 ) EndFunc ;==> _SplashCome () Func _SplashEnlarge ( $sPngPath, $iCoeff=1 ) If Not $hImage1 Then _ImageInit ( $sPngPath ) If Not $hGui Then $hGui = GUICreate ( $sGuiTitle, $iWidth , $iHeight, -1, -1, -1, BitOR ( $WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW ) ) For $iWidth = 20 To $iHeight*$iCoeff Step 5 WinMove ( $hGui, '', ( @DesktopWidth - $iWidth )/2, ( @DesktopHeight - $iHeight )/2, $iWidth, $iHeight ) GUISetState ( @SW_SHOW ) $hImage1 = _ImageResize ( $sPngPath, $iWidth, $iHeight ) _SetBitMap ( $hGui, $hImage1, 255, $iWidth, $iHeight ) Sleep ( 20 ) Next _WinGetPos () Sleep ( 1000 ) EndFunc ;==> _SplashEnlarge () Func _SplashFade ( $sPngPath ) For $i = 255 To 5 Step -5 _SetBitMap ( $hGui, $hImage1, $i, $iLastWidth, $iLastHeight ) Sleep ( 30 ) Next _ImageDispose ( $hImage1 ) Sleep ( 1000 ) EndFunc ;==> _SplashFade () Func _SplashGoes ( $sPngPath ) For $iWidth = $iLastWidth To 10 Step -12 WinMove ( $hGui, '', ( @DesktopWidth - $iWidth )/2, ( @DesktopHeight - $iHeight )/2 , $iWidth, $iWidth/$iRatio ) GUISetState ( @SW_SHOW ) $hImage1 = _ImageResize ( $sPngPath, $iWidth, $iWidth/$iRatio ) _SetBitMap ( $hGui, $hImage1, 255, $iWidth, $iWidth/$iRatio ) Sleep ( 10 ) Next _ImageDispose ( $hImage1 ) Sleep ( 1000 ) EndFunc ;==> _SplashGoes () Func _SplashMove ( $sPngPath, $iXStart=0, $iYStart=0, $iXEnd=0, $iYEnd=0, $iStep=5 ) Local $iW = 0 $iXStart = Number ( $iXStart ) $iYStart = Number ( $iYStart ) $iXEnd = Number ( $iXEnd ) $iYEnd = Number ( $iYEnd ) If Not $hImage1 Then _ImageInit ( $sPngPath ) If Not $hGui Then $hGui = GUICreate ( $sGuiTitle, $iWidth , $iHeight, -1, -1, -1, BitOR ( $WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW ) ) _SetBitMap ( $hGui, $hImage1, 255, $iWidth, $iHeight ) $iZ = ( _Max ( $iXStart, $iXEnd ) - _Min ( $iXStart, $iXEnd ) )/$iStep If $iZ Then $iY = $iYStart $iW = Abs ( ( _Max ( $iYStart, $iYEnd ) - _Min ( $iYStart, $iYEnd ) )/$iZ ) If $iXEnd < $iXStart Then $iStep = - Abs ( $iStep ) If $iYEnd < $iYStart Then $iW = -$iW For $iX = $iXStart To $iXEnd Step $iStep WinMove ( $hGui, '', $iX, $iY ) GUISetState ( @SW_SHOW ) $iY = $iY + $iW Sleep ( 10 ) Next Else $iX = $iXStart If $iYEnd < $iYStart Then $iStep = - Abs ( $iStep ) For $iY = $iYStart To $iYEnd Step $iStep WinMove ( $hGui, '', $iX, $iY ) GUISetState ( @SW_SHOW ) Sleep ( 10 ) Next EndIf _WinGetPos () Sleep ( 1000 ) EndFunc ;==> _SplashMove () Func _SplashUnFade ( $sPngPath ) If Not $hImage1 Then _ImageInit ( $sPngPath ) If Not $hGui Then $hGui = GUICreate ( $sGuiTitle, $iWidth, $iHeight, -1, -1, -1, BitOR ( $WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW ) ) WinMove ( $hGui, '', ( @DesktopWidth - $iWidth )/2, ( @DesktopHeight - $iHeight )/2, $iWidth, $iHeight ) _WinGetPos () For $i = 5 To 255 Step 5 _SetBitMap ( $hGui, $hImage1, $i, $iLastWidth, $iLastHeight ) GUISetState ( @SW_SHOW ) Sleep ( 80 ) Next Sleep ( 1000 ) EndFunc ;==> _SplashUnFade () Func _WinGetPos () Local $aPos = WinGetPos ( $hGui ) $iLastWidth = $aPos[2] $iLastHeight = $aPos[3] EndFunc ;==> _WinGetPos ()