Jump to content

Recommended Posts

Posted

I remember seeing a thread a while back where someone wrote this amazing effect where the splashimage would dissolve onto the screen. I forget who was the author, but I thought it was GaryFrost. I can't seem to find the thread through the search tool. Does anyone know which one I'm talking about and if so, do you have the link for it? Thanks.

Posted (edited)

I remember seeing a thread a while back where someone wrote this amazing effect where the splashimage would dissolve onto the screen. I forget who was the author, but I thought it was GaryFrost. I can't seem to find the thread through the search tool. Does anyone know which one I'm talking about and if so, do you have the link for it? Thanks.

Mayb this? I got this example from LIMITER Media Player v.3.4

#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>

;~ Splash
Global Const $AC_SRC_ALPHA = 1

_GDIPlus_Startup()

$pngSrc = "splash.png"

$hImage = _GDIPlus_ImageLoadFromFile($pngSrc)
$width = _GDIPlus_ImageGetWidth($hImage)
$height = _GDIPlus_ImageGetHeight($hImage)

$Splash = GUICreate("", $width, $height, -1, -1, $WS_POPUP, $WS_EX_LAYERED, $DS_MODALFRAME)

GUISetState(@SW_LOCK)

SetBitmap($Splash, $hImage, 0)

GUISetState()

WinSetOnTop($Splash, "", 1)

For $i = 0 To 255 Step 1
    SetBitmap($Splash, $hImage, $i)
    ;Sleep(10)
Next

Sleep(1000)

For $i = 255 To 0 Step -1
    SetBitmap($Splash, $hImage, $i)
Next

GUIDelete($Splash)

_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()

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

post-26067-1213072892_thumb.png

splash.zip

Edited by rasim

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
×
×
  • Create New...