Jump to content
Sign in to follow this  
youknowwho4eva

GDI+ Loading Screen

Recommended Posts

youknowwho4eva

My internet was down at work from last wednesday till about 2 minutes ago. So while being bored out of my mind, and writing up my new database program, I made this nifty little please wait program. I know it's not as small or clean as it could or should be but I like it so :P. I was at first aiming to emulate the Iphone Please wait thingy, but it evolved into this. It has it's own Youknowwho flare to it.

CODE
#include <GUIConstantsEx.au3>

#include <GDIplus.au3>

#include <WindowsConstants.au3>

#include <Misc.au3>

HotKeySet("x","exitprog")

Global $curve1[100][2], $curve2[100][2], $curve3[100][2], $curve4[100][2], $curve5[100][2], $curve6[100][2], $curve7[100][2], $curve8[100][2], $curve9[100][2], $curve10[100][2]

$waittime = 1

Opt("MouseCoordMode", 2)

Opt("Trayiconhide", 1)

$hwnd = GUICreate("Please Wait", 200, 200,-1,-1,$ws_popup)

GUISetBkColor("0x7F" & Hex(230, 2) & Hex(230, 2) & Hex(255, 2))

GUISetState()

_GDIPlus_Startup()

$graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)

$brush = _GDIPlus_BrushCreateSolid(0x1A000000) ;triangle fader

$hBrush = _GDIPlus_BrushCreateSolid (0x7000000)

$font_size = 25

$hFormat = _GDIPlus_StringFormatCreate ()

$hFamily = _GDIPlus_FontFamilyCreate ("News Gothic")

$hFont = _GDIPlus_FontCreate ($hFamily, $font_size, 2)

$Pen = _GDIPlus_PenCreate("0x7F" & Hex(00, 2) & Hex(00, 2) & Hex(255, 2), 6)

$Pen2 = _GDIPlus_PenCreate("0x7F" & Hex(50, 2) & Hex(50, 2) & Hex(255, 2), 6)

$Pen3 = _GDIPlus_PenCreate("0x7F" & Hex(100, 2) & Hex(100, 2) & Hex(255, 2), 6)

$Pen4 = _GDIPlus_PenCreate("0x7F" & Hex(150, 2) & Hex(150, 2) & Hex(255, 2), 6)

$Pen5 = _GDIPlus_PenCreate("0x7F" & Hex(230, 2) & Hex(230, 2) & Hex(255, 2), 6)

$text = WinGetTitle("Please Wait")

$tLayout = _GDIPlus_RectFCreate (7, 77, 0, 0)

While 1

$curve1[0][0] = 5

$curve1[1][0] = 10

$curve1[1][1] = 55

$curve1[2][0] = 20

$curve1[2][1] = 55

$curve1[3][0] = 50

$curve1[3][1] = 75

$curve1[4][0] = 40

$curve1[4][1] = 75

$curve1[5][0] = 10

$curve1[5][1] = 55

$curve2[0][0] = 5

$curve2[1][0] = 20

$curve2[1][1] = 20

$curve2[2][0] = 40

$curve2[2][1] = 20

$curve2[3][0] = 80

$curve2[3][1] = 70

$curve2[4][0] = 60

$curve2[4][1] = 70

$curve2[5][0] = 20

$curve2[5][1] = 20

$curve3[0][0] = 5

$curve3[1][0] = 95

$curve3[1][1] = 20

$curve3[2][0] = 105

$curve3[2][1] = 20

$curve3[3][0] = 105

$curve3[3][1] = 60

$curve3[4][0] = 95

$curve3[4][1] = 60

$curve3[5][0] = 95

$curve3[5][1] = 20

$curve4[0][0] = 5

$curve4[1][0] = 180

$curve4[1][1] = 20

$curve4[2][0] = 160

$curve4[2][1] = 20

$curve4[3][0] = 120

$curve4[3][1] = 70

$curve4[4][0] = 140

$curve4[4][1] = 70

$curve4[5][0] = 180

$curve4[5][1] = 20

$curve5[0][0] = 5

$curve5[1][0] = 190

$curve5[1][1] = 55

$curve5[2][0] = 180

$curve5[2][1] = 55

$curve5[3][0] = 150

$curve5[3][1] = 75

$curve5[4][0] = 160

$curve5[4][1] = 75

$curve5[5][0] = 190

$curve5[5][1] = 55

$curve6[0][0] = 5

$curve6[1][0] = 190

$curve6[1][1] = 145

$curve6[2][0] = 180

$curve6[2][1] = 145

$curve6[3][0] = 150

$curve6[3][1] = 125

$curve6[4][0] = 160

$curve6[4][1] = 125

$curve6[5][0] = 190

$curve6[5][1] = 145

$curve7[0][0] = 5

$curve7[1][0] = 180

$curve7[1][1] = 180

$curve7[2][0] = 160

$curve7[2][1] = 180

$curve7[3][0] = 120

$curve7[3][1] = 130

$curve7[4][0] = 140

$curve7[4][1] = 130

$curve7[5][0] = 180

$curve7[5][1] = 180

$curve8[0][0] = 5

$curve8[1][0] = 95

$curve8[1][1] = 180

$curve8[2][0] = 105

$curve8[2][1] = 180

$curve8[3][0] = 105

$curve8[3][1] = 140

$curve8[4][0] = 95

$curve8[4][1] = 140

$curve8[5][0] = 95

$curve8[5][1] = 180

$curve9[0][0] = 5

$curve9[1][0] = 20

$curve9[1][1] = 180

$curve9[2][0] = 40

$curve9[2][1] = 180

$curve9[3][0] = 80

$curve9[3][1] = 130

$curve9[4][0] = 60

$curve9[4][1] = 130

$curve9[5][0] = 20

$curve9[5][1] = 180

$curve10[0][0] = 5

$curve10[1][0] = 10

$curve10[1][1] = 145

$curve10[2][0] = 20

$curve10[2][1] = 145

$curve10[3][0] = 50

$curve10[3][1] = 125

$curve10[4][0] = 40

$curve10[4][1] = 125

$curve10[5][0] = 10

$curve10[5][1] = 145

If $waittime = 1 Then

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen4)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen3)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen2)

$waittime += 1

ElseIf $waittime = 2 Then

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen2)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen4)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen3)

$waittime += 1

ElseIf $waittime = 3 Then

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen3)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen2)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen4)

$waittime += 1

ElseIf $waittime = 4 Then

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen4)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen3)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen2)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen5)

$waittime += 1

ElseIf $waittime = 5 Then

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen4)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen3)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen2)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen5)

$waittime += 1

ElseIf $waittime = 6 Then

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen4)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen3)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen2)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen5)

$waittime += 1

ElseIf $waittime = 7 Then

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen4)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen3)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen2)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen5)

$waittime += 1

ElseIf $waittime = 8 Then

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen4)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen3)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen2)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen5)

$waittime += 1

ElseIf $waittime = 9 Then

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen4)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen3)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen2)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen5)

$waittime += 1

ElseIf $waittime = 10 Then

_GDIPlus_GraphicsDrawCurve($graphics,$curve1,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve2,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve3,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve4,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve5,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve6,$pen5)

_GDIPlus_GraphicsDrawCurve($graphics,$curve7,$pen4)

_GDIPlus_GraphicsDrawCurve($graphics,$curve8,$pen3)

_GDIPlus_GraphicsDrawCurve($graphics,$curve9,$pen2)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen)

_GDIPlus_GraphicsDrawCurve($graphics,$curve10,$pen)

$waittime = 1

EndIf

For $i = 1 to 4

_GDIPlus_GraphicsDrawStringEx ($graphics, $text, $hFont, $tLayout, $hFormat, $hBrush)

Next

Sleep(100)

WEnd

Func exitprog()

_GDIPlus_GraphicsDispose($graphics)

_GDIPlus_Shutdown()

Exit

EndFunc


Giggity

Share this post


Link to post
Share on other sites
youknowwho4eva

@Firefox, I think you copied something wrong or something. Your script would only create the little light blue window. Did you scroll down to copy it all?


Giggity

Share this post


Link to post
Share on other sites
FireFox

@youknowwho4eva

I can be stupid sometimes :P

Its nice example :unsure: it could be ameliorated (approach the real apple loading)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
youknowwho4eva

Yea I could have made it 100% like it, but you know how it is, you get an unexpected result while playing that you like better than your original thought.


Giggity

Share this post


Link to post
Share on other sites
UEZ

@youknowwho4eva: I assume that your are hating loops :P

UEZ :unsure:


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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
youknowwho4eva

Naw, my thought process is usually: Play, build a lil, play, build a lil more, play, clean up with loops and such if I feel like it :P which I usually don't.


Giggity

Share this post


Link to post
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
Sign in to follow this  

×