Jump to content

Recommended Posts

Posted (edited)

MS Splash Screens

The office 2016/17 office suite has made many people turn heads with its functions and especially their splash screen.

I now present to you, the MS Style Splash Screen. For Rookies, Novices and anyone who wants a ready made splash screen for your gui application.

You can now download it and also try it out yourself.
You have three colors to choose from:
Blue
Red
Green

All three colours are from the famous programs.
I also included the KODA form to you can have freedom with this splash screen.
Note: the KODA form does not have the three colours as well as the correct blue. 

Have fun and enjoy.

Note:
Thanks to kaz for updating the side scrolling dots.

 

 

Edited by Skeletor

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

  • 2 months later...
  • 1 month later...
Posted
On 10/16/2017 at 4:41 AM, Skeletor said:

Note:

 

I will update the splash to add the automated 3 dots animation at a later stage. 

 

@Skeletor Just wondering if the three dot animation was still something you were looking at?  Thanks!

 

  • 2 weeks later...
  • 3 weeks later...
Posted

I tried to do a small animation. i took the code of this topic and some code from GDI+ animated loading screens build 2014-06-20 from UEZ

GDI+ animated loading screens

It's not perfect ...

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

#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <TrayConstants.au3>


Global Const $hDwmApiDll = DllOpen("dwmapi.dll")
Global $sChkAero = DllStructCreate("int;")
DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero))
Global $bAero = DllStructGetData($sChkAero, 1)
Global $fStep = 0.02
If Not $bAero Then $fStep = 1.25

_GDIPlus_Startup()

Global $iW = 300, $iH = 120

$hGUI = GUICreate("Office", 442, 252, @DesktopWidth /2.95, @DesktopHeight /3.2, $WS_POPUP)
GUISetBkColor(0xB7472A)
;GUISetBkColor(0x2b579a) ;Word Blue
GUISetBkColor(0x217346) ;Excel Green
$Label1 = GUICtrlCreateLabel("SciTE4AutoIt3", 8, 8, 102, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label2 = GUICtrlCreateLabel("AutoIt 247", 64, 72, 314, 75, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 40, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label3 = GUICtrlCreateLabel("Starting...", 10, 205, 54, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label4 = GUICtrlCreateLabel("r", 410, 4, 20, 21)
GUICtrlSetFont(-1, 12, 400, 0, "Webdings")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Closes the splash screen.")
$Label5 = GUICtrlCreateLabel("0", 385, 0, 20, 21)
GUICtrlSetFont(-1, 12, 400, 0, "Webdings")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Minimises the splash screen.")
GUISetState(@SW_SHOW)

Global Const $iPic = GUICtrlCreatePic("", 80, 150, $iW, $iH)
GUICtrlSetState(-1, $GUI_DISABLE)
WinSetTrans($hGUI, "", 0)
GUISetState()
Global $hHBmp_BG, $hB, $iSleep = 50
GUIRegisterMsg($WM_TIMER, "PlayAnim")
DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0)

Global $z, $iPerc
For $z = 1 To 255 Step $fStep
    WinSetTrans($hGUI, "", $z)
Next

Do
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            GUIRegisterMsg($WM_TIMER, "")
            _WinAPI_DeleteObject($hHBmp_BG)
            _GDIPlus_Shutdown()
            GUIDelete()
            Exit
    EndSwitch
Until False

Func PlayAnim()
    $hHBmp_BG = _GDIPlus_ThreeBalls($iW, $iH, $iPerc)
    $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG)
    If $hB Then _WinAPI_DeleteObject($hB)
    _WinAPI_DeleteObject($hHBmp_BG)
;   Joue sur la vitesse d affichage
    $iPerc += 0.5
    If $iPerc > 110 Then $iPerc = 0
EndFunc   ;==>PlayAnim

Func _GDIPlus_ThreeBalls($iW, $iH, $iPerc, $sString = "Please wait...", $iRadius = 12, $iBalls = 3, $bHBitmap = True)
    Local Const $iDiameter = $iRadius * 2

    Local $tPointF1 = DllStructCreate("float;float")
    Local $pPointF1 = DllStructGetPtr($tPointF1)
    Local $tPointF2 = DllStructCreate("float;float")
    Local $pPointF2 = DllStructGetPtr($tPointF2)
    DllStructSetData($tPointF1, 1, $iDiameter)
    DllStructSetData($tPointF1, 2, 0)
    DllStructSetData($tPointF2, 1, $iDiameter)
    DllStructSetData($tPointF2, 2, $iDiameter)

    Local $hBrushBall2 = DllCall($__g_hGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", 0xFFcecbca, "uint", 0xFFf2eeed, "int", 1, "int*", 0)
    $hBrushBall2 = $hBrushBall2[6]

    Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)

    Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
    _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)

    Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid(0xFF217346)


    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushBall1)

    Local $aPos[$iBalls + 2][4], $iArrayPos, $j = 1
    Local Static $aCircle[$iBalls + 1]
    For $i = 0 To $iBalls - 1
        $aPos[($iBalls - 1) - $i][0] = ($iW / 2) - (($iDiameter + $iRadius) * ($i + 1)) + (($iBalls - 1) / 2 * ($iDiameter + $iRadius)) + $iDiameter
        $aPos[($iBalls - 1) - $i][1] = ($iH - $iRadius) / 2
        _GDIPlus_GraphicsFillEllipse($hCtxt, $aPos[($iBalls - 1) - $i][0], $aPos[($iBalls - 1) - $i][1], $iDiameter, $iDiameter, $hBrushBall1) ;draw background
        $aPos[($iBalls - 1) - $i][2] = 100 / $iBalls
        $iArrayPos = Int($iPerc / ($aPos[($iBalls - 1) - $i][2]))
        $aPos[$iArrayPos][3] = ($iPerc - ($iArrayPos * ($aPos[($iBalls - 1) - $i][2]))) / $aPos[($iBalls - 1) - $i][2]
        If $iArrayPos > 0 Then
            For $j = 0 To $iArrayPos - 1
                $aPos[$j][3] = 1
            Next
        EndIf
    Next


; Animation remplissage des balles
    Local $fMax = 2, $hPen = _GDIPlus_PenCreate(0x217346, 1)


    Local $i, $fDH
    Local Static $s, $t


    For $i = 0 To $iBalls - 1
        _GDIPlus_PenSetColor($hPen, 0xFF217346)
        $iHeight = $iRadius * 0.05
        $fDH = Sin($s + Cos($i + $t)) * $iHeight * 0.66666
        $s += 0.05
        _GDIPlus_GraphicsFillEllipse($hCtxt, $iRadius + $aPos[$i][0] - $iRadius * $fDH, $iRadius + $aPos[$i][1] - $iRadius * $fDH, $iDiameter * $fDH, $iDiameter * $fDH, $hBrushBall2)
    Next


    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BrushDispose($hBrushBall1)
    _GDIPlus_BrushDispose($hBrushBall2)
    _GDIPlus_PenDispose($hPen)

    If $bHBitmap Then
        Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
        _GDIPlus_BitmapDispose($hBitmap)
        Return $hHBITMAP
    EndIf
    Return $hBitmap
EndFunc

A lots of code only for three dots

Posted

Thats really not that much code

Nice Job,

It'd be nice to have the X button work and a fade out

Do
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $Label4
            ConsoleWrite("Exit")
            GUIRegisterMsg($WM_TIMER, "")
            _WinAPI_DeleteObject($hHBmp_BG)
            _GDIPlus_Shutdown()
            For $z = 255 To 1 Step -$fStep
                WinSetTrans($hGUI, "", $z)
            Next
            GUIDelete($hGUI)
            Exit
    EndSwitch
Until False

 

Posted

Thanks UEZ again for his work.

I think this part of code should be improved 

For $i = 0 To $iBalls - 1
        _GDIPlus_PenSetColor($hPen, 0xFF217346)
        $iHeight = $iRadius * 0.05
        $fDH = Sin($s + Cos($i + $t)) * $iHeight * 0.66666
        $s += 0.05
        _GDIPlus_GraphicsFillEllipse($hCtxt, $iRadius + $aPos[$i][0] - $iRadius * $fDH, $iRadius + $aPos[$i][1] - $iRadius * $fDH, $iDiameter * $fDH, $iDiameter * $fDH, $hBrushBall2)
    Next

 

Posted

A little bit cleaner, with color  choice in one place : 

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

#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <TrayConstants.au3>


Global Const $sExcelColor = "217346", $sWordColor = "2b579a", $sOutlookColor = "B7472A"

Global Const $sThemeColor = $sOutlookColor

Global Const $hDwmApiDll = DllOpen("dwmapi.dll")
Global $sChkAero = DllStructCreate("int;")
DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero))
Global $bAero = DllStructGetData($sChkAero, 1)
Global $fStep = 0.02
If Not $bAero Then $fStep = 1.25

_GDIPlus_Startup()

Global $iW = 300, $iH = 120

$hGUI = GUICreate("Office", 442, 252, @DesktopWidth /2.95, @DesktopHeight /3.2, $WS_POPUP)

GUISetBkColor("0x" & $sThemeColor)


;~ GUISetBkColor(0xB7472A)
;GUISetBkColor(0x2b579a) ;Word Blue
;~ GUISetBkColor(0x217346) ;Excel Green
$Label1 = GUICtrlCreateLabel("SciTE4AutoIt3", 8, 8, 102, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label2 = GUICtrlCreateLabel("AutoIt 247", 64, 72, 314, 75, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 40, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label3 = GUICtrlCreateLabel("Starting...", 10, 205, 54, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label4 = GUICtrlCreateLabel("r", 410, 4, 20, 21)
GUICtrlSetFont(-1, 12, 400, 0, "Webdings")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Closes the splash screen.")
$Label5 = GUICtrlCreateLabel("0", 385, 0, 20, 21)
GUICtrlSetFont(-1, 12, 400, 0, "Webdings")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Minimises the splash screen.")
GUISetState(@SW_SHOW)

Global Const $iPic = GUICtrlCreatePic("", 80, 150, $iW, $iH)
GUICtrlSetState(-1, $GUI_DISABLE)
WinSetTrans($hGUI, "", 0)
GUISetState()
Global $hHBmp_BG, $hB, $iSleep = 100
GUIRegisterMsg($WM_TIMER, "PlayAnim")
DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0)

Global $z, $iPerc
For $z = 1 To 255 Step $fStep
    WinSetTrans($hGUI, "", $z)
Next

Do
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $Label4
            ConsoleWrite("Exit")
            GUIRegisterMsg($WM_TIMER, "")
            _WinAPI_DeleteObject($hHBmp_BG)
            _GDIPlus_Shutdown()
            For $z = 255 To 1 Step -$fStep
                WinSetTrans($hGUI, "", $z)
            Next
            GUIDelete($hGUI)
            Exit
    EndSwitch
Until False

Func PlayAnim()
    $hHBmp_BG = _GDIPlus_ThreeBalls($iW, $iH, $iPerc)
    $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG)
    If $hB Then _WinAPI_DeleteObject($hB)
    _WinAPI_DeleteObject($hHBmp_BG)
;   Joue sur la vitesse d affichage
    $iPerc += 1
    If $iPerc > 110 Then $iPerc = 0
EndFunc   ;==>PlayAnim

Func _GDIPlus_ThreeBalls($iW, $iH, $iPerc, $sString = "Please wait...", $iRadius = 5, $iBalls = 3, $bHBitmap = True)
    Local Const $iDiameter = $iRadius * 2

    Local $tPointF1 = DllStructCreate("float;float")
    Local $pPointF1 = DllStructGetPtr($tPointF1)
    Local $tPointF2 = DllStructCreate("float;float")
    Local $pPointF2 = DllStructGetPtr($tPointF2)
    DllStructSetData($tPointF1, 1, $iDiameter)
    DllStructSetData($tPointF1, 2, 0)
    DllStructSetData($tPointF2, 1, $iDiameter)
    DllStructSetData($tPointF2, 2, $iDiameter)

    Local $hBrushBall2 = DllCall($__g_hGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", 0xFFcecbca, "uint", 0xFFf2eeed, "int", 1, "int*", 0)
    $hBrushBall2 = $hBrushBall2[6]

    Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)

    Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
    _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)

    Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid("0xFF" & $sThemeColor)

    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushBall1)

    Local $aPos[$iBalls + 2][4], $iArrayPos, $j = 1
    Local Static $aCircle[$iBalls + 1]
    For $i = 0 To $iBalls - 1
        $aPos[($iBalls - 1) - $i][0] = ($iW / 2) - (($iDiameter  * 3) * ($i + 1)) + (($iBalls - 1) / 2 * ($iDiameter  * 3)) + $iDiameter * 3
        $aPos[($iBalls - 1) - $i][1] = ($iH - $iRadius) / 2
        _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[($iBalls - 1) - $i][0], $aPos[($iBalls - 1) - $i][1], $iRadius, $hBrushBall1)
        $aPos[($iBalls - 1) - $i][2] = 100 / $iBalls
        $iArrayPos = Int($iPerc / ($aPos[($iBalls - 1) - $i][2]))
        $aPos[$iArrayPos][3] = ($iPerc - ($iArrayPos * ($aPos[($iBalls - 1) - $i][2]))) / $aPos[($iBalls - 1) - $i][2]
        If $iArrayPos > 0 Then
            For $j = 0 To $iArrayPos - 1
                $aPos[$j][3] = 1
            Next
        EndIf
    Next


; Animation remplissage des balles
    Local $i, $fDH
    Local Static $s


    For $i = 0 To $iBalls - 1
        $fDH = Sin($s + Cos($i ))
        $s += 0.1
        _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1], $iRadius * abs($fDH) , $hBrushBall2)
    Next

    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BrushDispose($hBrushBall1)
    _GDIPlus_BrushDispose($hBrushBall2)
;~  _GDIPlus_PenDispose($hPen)

    If $bHBitmap Then
        Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
        _GDIPlus_BitmapDispose($hBitmap)
        Return $hHBITMAP
    EndIf
    Return $hBitmap
EndFunc



func _GDIPlus_GraphicsFillCircle($hCtxt, $iXCenterPos, $iCenterYPos, $iRadius, $hBrush)
    _GDIPlus_GraphicsFillEllipse($hCtxt, $iXCenterPos - $iRadius, $iCenterYPos - $iRadius,  $iRadius * 2, $iRadius * 2, $hBrush)
endFunc

 

Posted

You can replace the line

_GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1], $iRadius * abs($fDH) , $hBrushBall2)

by 

$height = 20
_GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1]  + $height * abs($fDH), $iRadius  , $hBrushBall2)

to simply obtain an other animation.

Posted

More cleaning, better animation...perhaps

Global Const $sExcelColor = "217346", $sWordColor = "2b579a", $sOutlookColor = "B7472A"
Global Const $sThemeColor = $sWordColor

Local Const $PI = 3.141592653589793


Global Const $hDwmApiDll = DllOpen("dwmapi.dll")
Global $sChkAero = DllStructCreate("int;")
DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero))
Global $bAero = DllStructGetData($sChkAero, 1)
Global $fStep = 0.02
If Not $bAero Then $fStep = 1.25

_GDIPlus_Startup()

Global $iW = 300, $iH = 120

$hGUI = GUICreate("Office", 442, 252, @DesktopWidth / 2.95, @DesktopHeight / 3.2, $WS_POPUP)

GUISetBkColor("0x" & $sThemeColor)


;GUISetBkColor(0xB7472A)
;GUISetBkColor(0x2b579a) ;Word Blue
;GUISetBkColor(0x217346) ;Excel Green
$Label1 = GUICtrlCreateLabel("SciTE4AutoIt3", 8, 8, 102, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label2 = GUICtrlCreateLabel("AutoIt 247", 64, 72, 314, 75, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 40, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label3 = GUICtrlCreateLabel("Starting...", 10, 205, 54, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label4 = GUICtrlCreateLabel("r", 410, 4, 20, 21)
GUICtrlSetFont(-1, 12, 400, 0, "Webdings")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Closes the splash screen.")
$Label5 = GUICtrlCreateLabel("0", 385, 0, 20, 21)
GUICtrlSetFont(-1, 12, 400, 0, "Webdings")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Minimises the splash screen.")
GUISetState(@SW_SHOW)

Global Const $iPic = GUICtrlCreatePic("", 80, 150, $iW, $iH)
GUICtrlSetState(-1, $GUI_DISABLE)
WinSetTrans($hGUI, "", 0)
GUISetState()
Global $hHBmp_BG, $hB, $iSleep = 100
GUIRegisterMsg($WM_TIMER, "PlayAnim")
DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0)

Global $z, $iPerc
For $z = 1 To 255 Step $fStep
    WinSetTrans($hGUI, "", $z)
Next

Do
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $Label4
            ConsoleWrite("Exit")
            GUIRegisterMsg($WM_TIMER, "")
            _WinAPI_DeleteObject($hHBmp_BG)
            _GDIPlus_Shutdown()
            For $z = 255 To 1 Step -$fStep
                WinSetTrans($hGUI, "", $z)
            Next
            GUIDelete($hGUI)
            Exit
    EndSwitch
Until False

Func PlayAnim()
    Local $iballs = 3
    $hHBmp_BG = _GDIPlus_ThreeBalls($iW, $iH, $iPerc, 5, $iballs)
    $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG)
    If $hB Then _WinAPI_DeleteObject($hB)
    _WinAPI_DeleteObject($hHBmp_BG)
    ;   Joue sur la vitesse d affichage
    $iPerc += 30
    If $iPerc > (90 * ($iballs + 2)) Then $iPerc = 0
EndFunc   ;==>PlayAnim

Func _GDIPlus_ThreeBalls($iW, $iH, $iPerc, $iRadius = 5, $iballs = 3, $bHBitmap = True)
    Local Const $iDiameter = $iRadius * 2

    Local $tPointF1 = DllStructCreate("float;float")
    Local $pPointF1 = DllStructGetPtr($tPointF1)
    Local $tPointF2 = DllStructCreate("float;float")
    Local $pPointF2 = DllStructGetPtr($tPointF2)
    DllStructSetData($tPointF1, 1, $iDiameter)
    DllStructSetData($tPointF1, 2, 0)
    DllStructSetData($tPointF2, 1, $iDiameter)
    DllStructSetData($tPointF2, 2, $iDiameter)

    Local $hBrushBall2 = DllCall($__g_hGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", 0xFFcecbca, "uint", 0xFFf2eeed, "int", 1, "int*", 0)
    $hBrushBall2 = $hBrushBall2[6]

    Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)

    Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
    _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)

    Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid("0xFF" & $sThemeColor)

    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushBall1)

    Local $aPos[$iballs][3]
    Local Static $aCircle[$iballs + 1]
    For $i = 0 To $iballs - 1
        $aPos[($iballs - 1) - $i][0] = ($iW / 2) - (($iDiameter * 3) * ($i + 1)) + (($iballs - 1) / 2 * ($iDiameter * 3)) + $iDiameter * 3
        $aPos[($iballs - 1) - $i][1] = ($iH - $iRadius) / 2
        _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[($iballs - 1) - $i][0], $aPos[($iballs - 1) - $i][1], $iRadius, $hBrushBall1)
    Next


    Local $i, $fDH, $height
    For $i = 0 To $iballs - 1

        Local $iBallValue = $iPerc - ($i * 90)
        If ($iBallValue < 0 Or $iBallValue > 180) Then $iBallValue = 0

        $fDH = Sin($iBallValue * $PI / 180) / 2


        $height = $iRadius * 10
;~      _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1]  - ($height * abs($fDH)), $iRadius  , $hBrushBall2)

        _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1], $iRadius + $iRadius * $fDH, $hBrushBall2)

    Next

    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BrushDispose($hBrushBall1)
    _GDIPlus_BrushDispose($hBrushBall2)
;~  _GDIPlus_PenDispose($hPen)

    If $bHBitmap Then
        Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
        _GDIPlus_BitmapDispose($hBitmap)
        Return $hHBITMAP
    EndIf
    Return $hBitmap
EndFunc   ;==>_GDIPlus_ThreeBalls



Func _GDIPlus_GraphicsFillCircle($hCtxt, $iXCenterPos, $iCenterYPos, $iRadius, $hBrush)
    _GDIPlus_GraphicsFillEllipse($hCtxt, $iXCenterPos - $iRadius, $iCenterYPos - $iRadius, $iRadius * 2, $iRadius * 2, $hBrush)
EndFunc   ;==>_GDIPlus_GraphicsFillCircle

 

Posted

An other dots animation :

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

#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <TrayConstants.au3>


Global Const $sExcelColor = "217346", $sWordColor = "2b579a", $sOutlookColor = "B7472A"
Global Const $sThemeColor = $sOutlookColor

Local Const $PI = 3.141592653589793


Global Const $hDwmApiDll = DllOpen("dwmapi.dll")
Global $sChkAero = DllStructCreate("int;")
DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero))
Global $bAero = DllStructGetData($sChkAero, 1)
Global $fStep = 0.02
If Not $bAero Then $fStep = 1.25

_GDIPlus_Startup()

Global $iW = 442, $iH = 30

$hGUI = GUICreate("Office", $iW, 252, @DesktopWidth / 2.95, @DesktopHeight / 3.2, $WS_POPUP)

GUISetBkColor("0x" & $sThemeColor)


;GUISetBkColor(0xB7472A)
;GUISetBkColor(0x2b579a) ;Word Blue
;~ GUISetBkColor(0x217346) ;Excel Green
$Label1 = GUICtrlCreateLabel("SciTE4AutoIt3", 8, 8, 102, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label2 = GUICtrlCreateLabel("AutoIt 247", 64, 72, 314, 75, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 40, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label3 = GUICtrlCreateLabel("Starting...", 10, 205, 54, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label4 = GUICtrlCreateLabel("r", 410, 4, 20, 21)
GUICtrlSetFont(-1, 12, 400, 0, "Webdings")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Closes the splash screen.")
$Label5 = GUICtrlCreateLabel("0", 385, 0, 20, 21)
GUICtrlSetFont(-1, 12, 400, 0, "Webdings")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Minimises the splash screen.")
GUISetState(@SW_SHOW)

Global Const $iPic = GUICtrlCreatePic("", 0, 150, $iW, $iH)
GUICtrlSetState(-1, $GUI_DISABLE)
WinSetTrans($hGUI, "", 0)
GUISetState()
Global $hHBmp_BG, $hB, $iSleep = 20
GUIRegisterMsg($WM_TIMER, "PlayAnim")
DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0)


global $iballs = 5
global $aPos[$iballs][3]

For $i = 0 To $iballs - 1
    $aPos[($iballs - 1) - $i][0] = -10
    $aPos[($iballs - 1) - $i][1] = $iH / 2
Next
$aPos[0][2] = 1


Global $z, $iPerc
For $z = 1 To 255 Step $fStep
    WinSetTrans($hGUI, "", $z)
Next

Do
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $Label4
            ConsoleWrite("Exit")
            GUIRegisterMsg($WM_TIMER, "")
            _WinAPI_DeleteObject($hHBmp_BG)
            _GDIPlus_Shutdown()
            For $z = 255 To 1 Step -$fStep
                WinSetTrans($hGUI, "", $z)
            Next
            GUIDelete($hGUI)
            Exit
    EndSwitch
Until False

Func PlayAnim()

    $hHBmp_BG = _GDIPlus_LinearBalls($iW, $iH, $iPerc, 3, $iballs)
    $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG)
    If $hB Then _WinAPI_DeleteObject($hB)
    _WinAPI_DeleteObject($hHBmp_BG)


    If $aPos[$iballs - 1][2] = 2 Then
        For $i = 0 To $iballs - 1
            $aPos[$i][0] = - 10
            $aPos[$i][2] = 0
        Next

        $aPos[0][2] = 1
    EndIf
EndFunc   ;==>PlayAnim

Func _GDIPlus_LinearBalls($iW, $iH, $iPerc, $iRadius = 5, $iballs = 3, $bHBitmap = True)
    Local Const $iDiameter = $iRadius * 2

    Local $tPointF1 = DllStructCreate("float;float")
    Local $pPointF1 = DllStructGetPtr($tPointF1)
    Local $tPointF2 = DllStructCreate("float;float")
    Local $pPointF2 = DllStructGetPtr($tPointF2)
    DllStructSetData($tPointF1, 1, $iDiameter)
    DllStructSetData($tPointF1, 2, 0)
    DllStructSetData($tPointF2, 1, $iDiameter)
    DllStructSetData($tPointF2, 2, $iDiameter)

    Local $hBrushBall2 = DllCall($__g_hGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", 0xFFcecbca, "uint", 0xFFf2eeed, "int", 1, "int*", 0)
    $hBrushBall2 = $hBrushBall2[6]

    Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)

    Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
    _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)

    Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid("0xFF" & $sThemeColor)

    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushBall1)


    Local $i, $fDH, $height
    local $ixPartScreen = $iW/16

    For $i = 0 To $iballs - 1

        Local $iSpeed, $x
        if $aPos[$i][2] = 1 then
            if $aPos[$i][0] < $ixPartScreen * 7 Then
                $x = $aPos[$i][0]
                if $x < 0 then $x = 0
                $iSpeed = 5 + (20 * ((($ixPartScreen * 7) - $x) * 100 ) / ($ixPartScreen * 7)) / 100
            ElseIf $aPos[$i][0] > ($ixPartScreen * 9 - ($i * $iRadius * 1.5))  Then
                $iSpeed = 20 + (60 * ((($aPos[$i][0] - $ixPartScreen * 9)) * 100 ) / ($ixPartScreen * 9)) / 100
            Else
                $iSpeed = 2
            EndIf


            if $i > 0 and $aPos[$i - 1][0] - ($aPos[$i][0] + $iSpeed) < 13 and $aPos[$i][0] < $ixPartScreen * 9 Then
                $aPos[$i][0] = $aPos[$i - 1][0] - 13
            Else
                $aPos[$i][0] = $aPos[$i][0]  + $iSpeed
            EndIf

        EndIf

        if $i < $iballs - 1 Then
            if $aPos[$i][0] > $ixPartScreen * 3 then $aPos[$i + 1][2] = 1
        EndIf

        If $aPos[$i][0] > $iW + $iRadius  Then
            $aPos[$i][2] = 0
            if $i = $iballs - 1 Then $aPos[$i][2] = 2
        EndIf


        _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1], $iRadius , $hBrushBall2)

    Next

    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BrushDispose($hBrushBall1)
    _GDIPlus_BrushDispose($hBrushBall2)



    If $bHBitmap Then
        Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
        _GDIPlus_BitmapDispose($hBitmap)
        Return $hHBITMAP
    EndIf
    Return $hBitmap
EndFunc   ;==>_GDIPlus_LinearBalls



Func _GDIPlus_GraphicsFillCircle($hCtxt, $iXCenterPos, $iCenterYPos, $iRadius, $hBrush)
    _GDIPlus_GraphicsFillEllipse($hCtxt, $iXCenterPos - $iRadius, $iCenterYPos - $iRadius, $iRadius * 2, $iRadius * 2, $hBrush)
EndFunc   ;==>_GDIPlus_GraphicsFillCircle

 

  • 2 weeks later...
Posted (edited)

in

WinSetTrans($hGUI, "", 0) ; <---- change to 1 to avoid the initial flash  ;)
GUISetState()

change the 0 to a 1, to avoid the initial flash  ;)

PS: Also this looks better too

ConsoleWrite("Exit")
            For $z = 255 To 1 Step -$fStep
                WinSetTrans($hGUI, "", $z)
            Next
            GUIRegisterMsg($WM_TIMER, "")
            _WinAPI_DeleteObject($hHBmp_BG)
            _GDIPlus_Shutdown()
            GUIDelete($hGUI)

 

Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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...