#cs ---------------------------------------------------------------------------- AutoIt Version : 3.3.2.0 Auteur: DJSIR and noman Fonction du Script : Permet de faire un Splash avec une Image PNG #ce ---------------------------------------------------------------------------- #include-once #include #include #include #include Opt("MustDeclareVars", 0) Global Const $AC_SRC_ALPHA = 1 $First = 0 Global $Fade Func _MySplashOn($Path_Logo, $Fade = 0) _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($Path_Logo) $width = _GDIPlus_ImageGetWidth($hImage) $height = _GDIPlus_ImageGetHeight($hImage) $GUI = GUICreate("", $width, $height, -1, -1, $WS_POPUP, $WS_EX_LAYERED) SetBitmap($G001, $hImage, 0) GUISetState() WinSetOnTop($G001, "", 1) If $Fade = 1 Then For $i = 0 To 255 Step 10 SetBitmap($G001, $hImage, $i) Next SetBitmap($G001, $hImage, 255) Else EndIf $First = 1 EndFunc ;==>_MySplashOn Func _MySplashOff() If Not $First = 1 Then Return -1 If $Fade = 1 Then For $i = 255 To 0 Step -10 SetBitmap($GUI, $hImage, $i) Next EndIf _WinAPI_DeleteObject($hImage) _GDIPlus_Shutdown() GUIDelete($G001) EndFunc ;==>_MySplashOff Func SetBitmap($hGUI, $hImage, $iOpacity) 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", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _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