Jump to content

GDI+ animated loading screens build 2014-06-20 (32 examples)


UEZ
 Share

Recommended Posts

fantastic work, thanks for offering such fine lessons in gdi+

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

@all: I'm glad to hear that you like it and find the scripts useful.

Thanks for your comments.

I hope the source is more or less easy to understand and easy to adapt to your own needs ...

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Beautiful scripts, I like the blue ball in _GDIPlus_RotatingBokeh, it looks like downloading faster :)

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

Wow, beautiful. Was looking for something like this. Thanks.

Edit: these are all quite big. Any chance for some smaller ones that can be integrated as a small control at the bottom right of an existing GUI or even in a status bar? Examples:

http://zanstra.home.xs4all.nl/picks/progress.html

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Well, it's easier to embed the animated GIFs to your GUI rather than recode the animations!

For the animations on my 1st post you can do small modifications to put the animation e.g. to a button.

Example (_GDIPlus_RotatingBokeh):

;coded by UEZ build 2013-05-02, idea from http://tympanus.net/codrops/2012/11/14/creative-css-loading-animations/
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.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 Const $STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0
Global $iW = 300, $iH = 200
Global Const $hGUI = GUICreate("Rotating Bokeh", $iW, $iH)
Global Const $iBtn = GUICtrlCreateButton("Go", 250, 150, 40, 40, $BS_BITMAP)
Global Const $hBtn = GUICtrlGetHandle($iBtn)
GUICtrlCreateLabel("Animation Test GUI", 0, 0, 300, 40, $SS_CENTER)
GUICtrlSetFont(-1, 24, 400, 0, "Arial", 5)
Global Const $iEdit = GUICtrlCreateEdit("Waiting ...", 0, 45, 300, 100)
WinSetTrans($hGUI, "", 0)
GUISetState()
Global $hHBmp_BG, $hB
Global $z, $iPerc, $iFlipFlop = -1
For $z = 1 To 255 Step $fStep
    WinSetTrans($hGUI, "", $z)
Next

Do
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            AdlibUnRegister("PlayAnim")
            _WinAPI_DeleteObject($hHBmp_BG)
            _GDIPlus_Shutdown()
            GUIDelete()
            Exit
        Case $iBtn
            Switch $iFlipFlop
                Case -1
                    AdlibRegister("PlayAnim", 20)
                    $iFlipFlop *= -1
                    GUICtrlSetData($iEdit, "Transfer started! Please wait...")
                Case Else
                    AdlibUnRegister("PlayAnim")
                    $iFlipFlop *= -1
                    $hB = _SendMessage($hBtn, $BM_SETIMAGE, $IMAGE_BITMAP, 0)
                    If $hB Then _WinAPI_DeleteObject($hB)
                    GUICtrlSetData($iEdit, "Transfer stopped. Please Go to start again")
            EndSwitch
    EndSwitch
Until False

Func PlayAnim()
    $hHBmp_BG = _GDIPlus_RotatingBokeh(32, 32)
    $hB = _SendMessage($hBtn, $BM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG)
    If $hB Then _WinAPI_DeleteObject($hB)
    _WinAPI_DeleteObject($hHBmp_BG)
    $iPerc += 0.1
    If $iPerc > 99.9 Then $iPerc = 0
EndFunc

Func _GDIPlus_RotatingBokeh($iW, $iH, $bHBitmap = True)
    Local Const $hPen = _GDIPlus_PenCreate(0xFF303030)
    DllCall($ghGDIPDll, "uint", "GdipSetPenLineJoin", "handle", $hPen, "int", 2)
    Local $hBitmap = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", 0, "int", $GDIP_PXF32ARGB, "ptr", 0, "int*", 0)
    $hBitmap = $hBitmap[6]

    Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
    If @OSBuild < 6000 Then
        Local $iBtnColor = _WinAPI_GetSysColor($COLOR_BTNFACE)
        _GDIPlus_GraphicsClear($hCtxt, 0xFF000000 + 0x10000 * BitAND($iBtnColor, 0xFF) + BitAND($iBtnColor, 0x00FF00) + BitShift($iBtnColor, 16))
        ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iBtnColor = ' & Hex($iBtnColor,6) & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    EndIf

    Local Const $fDeg = ACos(-1) / 180, $iRadius = 12, $iBallSize = $iRadius / 1.77, $iCircleSize = $iBallSize + 2 * $iRadius, $iBallSize2 = $iBallSize / 2, _
                $iCircleSize2 = $iCircleSize / 2, $fFontSize = 5, $iW2 = -1 + $iW / 2, $iH2 = -1 + $iH / 2
    Local Static $iAngle = 0
    Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid(0xE004AC6B)
    Local Const $hBrushBall2 = _GDIPlus_BrushCreateSolid(0xC0E0AB27)
    Local Const $hBrushBall3 = _GDIPlus_BrushCreateSolid(0xD081B702)
    Local Const $hBrushBall4 = _GDIPlus_BrushCreateSolid(0xB0E70339)
    DllCall($ghGDIPDll, "int", "GdipDrawEllipse", "handle", $hCtxt, "handle", $hPen, "float", $iW2 - $iCircleSize2, "float", $iH2 - $iCircleSize2, "float", $iCircleSize, "float", $iCircleSize)
    DllCall($ghGDIPDll, "int", "GdipFillEllipse", "handle", $hCtxt, "handle", $hBrushBall1, "float", -$iBallSize2 + $iW2 + Cos(2.25 * $iAngle * $fDeg) * $iRadius, "float", -$iBallSize2 + $iH2 + Sin(2.25 * $iAngle * $fDeg) * $iRadius,"float", $iBallSize, "float", $iBallSize)
    DllCall($ghGDIPDll, "int", "GdipFillEllipse", "handle", $hCtxt, "handle", $hBrushBall2, "float", -$iBallSize2 + $iW2 + Cos(1.75 * $iAngle * $fDeg) * $iRadius, "float", -$iBallSize2 + $iH2 + Sin(1.75 * $iAngle * $fDeg) * $iRadius,"float", $iBallSize, "float", $iBallSize)
    DllCall($ghGDIPDll, "int", "GdipFillEllipse", "handle", $hCtxt, "handle", $hBrushBall3, "float", -$iBallSize2 + $iW2 + Cos(1.66 * $iAngle * $fDeg) * $iRadius, "float", -$iBallSize2 + $iH2 + Sin(1.66 * $iAngle * $fDeg) * $iRadius,"float", $iBallSize, "float", $iBallSize)
    DllCall($ghGDIPDll, "int", "GdipFillEllipse", "handle", $hCtxt, "handle", $hBrushBall4, "float", -$iBallSize2 + $iW2 + Cos(1.33 * $iAngle * $fDeg) * $iRadius, "float", -$iBallSize2 + $iH2 + Sin(1.33 * $iAngle * $fDeg) * $iRadius,"float", $iBallSize, "float", $iBallSize)
    $iAngle += 2.5

    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BrushDispose($hBrushBall1)
    _GDIPlus_BrushDispose($hBrushBall2)
    _GDIPlus_BrushDispose($hBrushBall3)
    _GDIPlus_BrushDispose($hBrushBall4)
    _GDIPlus_PenDispose($hPen)
    If $bHBitmap Then
        Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
        _GDIPlus_BitmapDispose($hBitmap)
        Return $hHBITMAP
    EndIf
    Return $hBitmap
EndFunc

When I find some time I will change the function parameters to be more flexible. The purpose of the animations was not to create small animations rather loading screens.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

For _GDIPlus_RotatingBokeh() I need a version of OS above XP?

Is it not working for you? What is not working?

It works in my WinXP VM without any problem.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

It's working on this computer Win XP x64 but on other computer of mine (XP x86) didn't work when I tried. That's weird.

Anyway nice example, thanks for share.

What do you mean with didn't work? Is the screen just black, is the script crashing or what else?

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

@Andreik: Hmmm, no idea what the problem is. I tested the scripts also on my physical WinXP x86 machine and all examples run as expected.

Very strange...

 

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 3 weeks later...

Added another example: _GDIPlus_IncreasingBalls.au3 (see 1st post).

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 2 months later...
Hi there,
Amazing scripts ! Nice and clean ;)
 
But I don't really know how to add to a simple script.
For exemple, if I want to add a loading animations during this script, how I can do that ?
 
MsgBox (0, "Installation", "MyApp will be installed...")
>Here the loading animations for waiting...
And in background the actions
RunWait...
If @error = 0 Then
MsgBox (0, "Installation", "Install OK")

for the moment i Use a splash scrren > SplashOff()
>So I will replace the splashoff() by the end of the loading animations

MsgBox (0, "Installation", "Install KO")
Exit
EndIf

you see my need, or I'm not clear? :)

Thank you !!

Edited by DraGula
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

×
×
  • Create New...