Hey Leute,
ich hab mich in den letzten Tagen zum Spaß einfach mal mit ein paar GDI+ Animationen beschäftigt, ist wie gesagt nichts großes, aber vielleicht könnt ihr mir ja was dazu sagen
Ladebildschirm 1:
Spoiler anzeigen
#include <GDIPlus.au3>
Global $stat = 1
Global $winkel=0
Global $x1=Cos($winkel)*40 + 40
Global $y1=Sin($winkel)*40 + 40
Global $x11=Cos($winkel-10)*40 + 40
Global $y11=Sin($winkel-10)*40 + 40
Global $x12=Cos($winkel-20)*40 + 40
Global $y12=Sin($winkel-20)*40 + 40
Global $x2=Cos($winkel+179)*40 + 40
Global $y2=Sin($winkel+179)*40 + 40
Global $x21=Cos($winkel+169)*40 + 40
Global $y21=Sin($winkel+169)*40 + 40
Global $x22=Cos($winkel+159)*40 + 40
Global $y22=Sin($winkel+159)*40 + 40
OnAutoItExitRegister("_EXIT")
AdlibRegister("_bewege",30)
AdlibRegister("_loading",100)
$Gui = GUICreate("",200,100)
$label = GUICtrlCreateLabel("Loading.",110,80)
_GDIPlus_Startup()
$brushWeiss = _GDIPlus_BrushCreateSolid(0xFFF0F0F0)
$brushGruen = _GDIPlus_BrushCreateSolid(0xFF60CCFF)
$brushGruen1 = _GDIPlus_BrushCreateSolid(0xBB60CCFF)
$brushGruen2 = _GDIPlus_BrushCreateSolid(0x7760CCFF)
$graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
$bitmap = _GDIPlus_BitmapCreateFromGraphics(100, 100, $graphic)
$buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
GUISetState()
Do
$msg = GUIGetMsg()
_GDIPlus_GraphicsFillRect($buffer, 0, 0, 100, 100, $brushWeiss)
_GDIPlus_GraphicsFillEllipse($buffer,$x1,$y1,20,20,$brushGruen)
_GDIPlus_GraphicsFillEllipse($buffer,$x11+3,$y11+3,14,14,$brushGruen1)
_GDIPlus_GraphicsFillEllipse($buffer,$x12+5,$y12+5,10,10,$brushGruen2)
_GDIPlus_GraphicsFillEllipse($buffer,$x2,$y2,20,20,$brushGruen)
_GDIPlus_GraphicsFillEllipse($buffer,$x21+5,$y21+5,14,14,$brushGruen1)
_GDIPlus_GraphicsFillEllipse($buffer,$x22+5,$y22+5,10,10,$brushGruen2)
_GDIPlus_GraphicsDrawImageRect($graphic, $bitmap, 0, 0, 100, 100)
Until $msg = -3
Func _EXIT()
_GDIPlus_BrushDispose($brushGruen)
_GDIPlus_BrushDispose($brushWeiss)
_GDIPlus_GraphicsDispose($graphic)
_GDIPlus_GraphicsDispose($buffer)
_GDIPlus_BitmapDispose($bitmap)
_GDIPlus_Shutdown()
EndFunc
Func _bewege()
If $winkel >= 360 Then $winkel = 0
$winkel += 0.2
$x1=Cos($winkel)*40 + 40
$y1=Sin($winkel)*40 + 40
$x11=Cos($winkel-10)*40 + 40
$y11=Sin($winkel-10)*40 + 40
$x12=Cos($winkel-20)*40 + 40
$y12=Sin($winkel-20)*40 + 40
$x2=Cos($winkel+179)*40 + 40
$y2=Sin($winkel+179)*40 + 40
$x21=Cos($winkel+169)*40 + 40
$y21=Sin($winkel+169)*40 + 40
$x22=Cos($winkel+159)*40 + 40
$y22=Sin($winkel+159)*40 + 40
EndFunc
Func _loading()
Switch $stat
Case 1
GUICtrlSetData($label,"Loading.")
$stat = 2
Case 2
GUICtrlSetData($label,"Loading..")
$stat = 3
Case 3
GUICtrlSetData($label,"Loading...")
$stat = 1
EndSwitch
EndFunc
Ladebildschirm 2:
Spoiler anzeigen
#include <GDIPlus.au3>
$x1 = 10
$x2 = 0
$x3 = -10
$x4 = -20
$x5 = -30
$x6 = -40
$x7 = -50
$x8 = -60
$x9 = -70
$x10 = -80
$x11 = -90
$x12 = -100
$x13 = -110
$x14 = -120
$x15 = -130
OnAutoItExitRegister("_EXIT")
AdlibRegister("_bewege",10)
$Gui = GUICreate("",500,50)
_GDIPlus_Startup()
$brushWeiss = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
$brushGruen = _GDIPlus_BrushCreateSolid(0xFF60CCFF)
$brushGruen1 = _GDIPlus_BrushCreateSolid(0xEE60CCFF)
$brushGruen2 = _GDIPlus_BrushCreateSolid(0xDD60CCFF)
$brushGruen3 = _GDIPlus_BrushCreateSolid(0xCC60CCFF)
$brushGruen4 = _GDIPlus_BrushCreateSolid(0xBB60CCFF)
$brushGruen5 = _GDIPlus_BrushCreateSolid(0xAA60CCFF)
$brushGruen6 = _GDIPlus_BrushCreateSolid(0x9960CCFF)
$brushGruen7 = _GDIPlus_BrushCreateSolid(0x8860CCFF)
$brushGruen8 = _GDIPlus_BrushCreateSolid(0x7760CCFF)
$brushGruen9 = _GDIPlus_BrushCreateSolid(0x6660CCFF)
$brushGruen10 = _GDIPlus_BrushCreateSolid(0x5560CCFF)
$brushGruen11 = _GDIPlus_BrushCreateSolid(0x4460CCFF)
$brushGruen12 = _GDIPlus_BrushCreateSolid(0x3360CCFF)
$brushGruen13 = _GDIPlus_BrushCreateSolid(0x2260CCFF)
$brushGruen14 = _GDIPlus_BrushCreateSolid(0x1160CCFF)
$graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
$bitmap = _GDIPlus_BitmapCreateFromGraphics(500, 50, $graphic)
$buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
GUISetState()
Do
$msg = GUIGetMsg()
_GDIPlus_GraphicsFillRect($buffer, 0, 0, 500, 50, $brushWeiss)
_GDIPlus_GraphicsFillEllipse($buffer,$x1,15,20,20,$brushGruen)
_GDIPlus_GraphicsFillEllipse($buffer,$x2,15,20,20,$brushGruen1)
_GDIPlus_GraphicsFillEllipse($buffer,$x3,15,20,20,$brushGruen2)
_GDIPlus_GraphicsFillEllipse($buffer,$x4,15,20,20,$brushGruen3)
_GDIPlus_GraphicsFillEllipse($buffer,$x5,15,20,20,$brushGruen4)
_GDIPlus_GraphicsFillEllipse($buffer,$x6,15,20,20,$brushGruen5)
_GDIPlus_GraphicsFillEllipse($buffer,$x7,15,20,20,$brushGruen6)
_GDIPlus_GraphicsFillEllipse($buffer,$x8,15,20,20,$brushGruen7)
_GDIPlus_GraphicsFillEllipse($buffer,$x9,15,20,20,$brushGruen8)
_GDIPlus_GraphicsFillEllipse($buffer,$x10,15,20,20,$brushGruen9)
_GDIPlus_GraphicsFillEllipse($buffer,$x11,15,20,20,$brushGruen10)
_GDIPlus_GraphicsFillEllipse($buffer,$x12,15,20,20,$brushGruen11)
_GDIPlus_GraphicsFillEllipse($buffer,$x13,15,20,20,$brushGruen12)
_GDIPlus_GraphicsFillEllipse($buffer,$x14,15,20,20,$brushGruen13)
_GDIPlus_GraphicsFillEllipse($buffer,$x15,15,20,20,$brushGruen14)
_GDIPlus_GraphicsFillRect($buffer,0,0,20,50,$brushWeiss)
_GDIPlus_GraphicsFillRect($buffer,460,0,20,50,$brushWeiss)
_GDIPlus_GraphicsDrawImageRect($graphic, $bitmap, 0, 0, 500, 50)
Until $msg = -3
Func _EXIT()
_GDIPlus_BrushDispose($brushGruen)
_GDIPlus_BrushDispose($brushGruen1)
_GDIPlus_BrushDispose($brushGruen2)
_GDIPlus_BrushDispose($brushGruen3)
_GDIPlus_BrushDispose($brushGruen4)
_GDIPlus_BrushDispose($brushGruen5)
_GDIPlus_BrushDispose($brushGruen6)
_GDIPlus_BrushDispose($brushGruen7)
_GDIPlus_BrushDispose($brushGruen8)
_GDIPlus_BrushDispose($brushGruen9)
_GDIPlus_BrushDispose($brushGruen10)
_GDIPlus_BrushDispose($brushGruen11)
_GDIPlus_BrushDispose($brushGruen12)
_GDIPlus_BrushDispose($brushGruen13)
_GDIPlus_BrushDispose($brushGruen14)
_GDIPlus_BrushDispose($brushWeiss)
_GDIPlus_GraphicsDispose($graphic)
_GDIPlus_GraphicsDispose($buffer)
_GDIPlus_BitmapDispose($bitmap)
_GDIPlus_Shutdown()
EndFunc
Func _bewege()
If $x1 < 460 Then $x1 += 2
If $x1 >= 460 Then $x1 = 0
If $x2 < 460 Then $x2 += 2
If $x2 >= 460 Then $x2 = 0
If $x3 < 460 Then $x3 += 2
If $x3 >= 460 Then $x3 = 0
If $x4 < 460 Then $x4 += 2
If $x4 >= 460 Then $x4 = 0
If $x5 < 460 Then $x5 += 2
If $x5 >= 460 Then $x5 = 0
If $x6 < 460 Then $x6 += 2
If $x6 >= 460 Then $x6 = 0
If $x7 < 460 Then $x7 += 2
If $x7 >= 460 Then $x7 = 0
If $x8 < 460 Then $x8 += 2
If $x8 >= 460 Then $x8 = 0
If $x9 < 460 Then $x9 += 2
If $x9 >= 460 Then $x9 = 0
If $x10 < 460 Then $x10 += 2
If $x10 >= 460 Then $x10 = 0
If $x11 < 460 Then $x11 += 2
If $x11 >= 460 Then $x11 = 0
If $x12 < 460 Then $x12 += 2
If $x12 >= 460 Then $x12 = 0
If $x13 < 460 Then $x13 += 2
If $x13 >= 460 Then $x13= 0
If $x14 < 460 Then $x14 += 2
If $x14 >= 460 Then $x14 = 0
If $x15 < 460 Then $x15 += 2
If $x15 >= 460 Then $x15 = 0
EndFunc
Und Nummer 3;)
Spoiler anzeigen
#include <GDIPlus.au3>
$angle = 1
$r = 1
$startangle = 0
Dim $brush[16]
OnAutoItExitRegister("_EXIT")
AdlibRegister("_bewege",15)
$Gui = GUICreate("",100,100)
_GDIPlus_Startup()
$brushWeiss = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
$brush[1] = _GDIPlus_BrushCreateSolid(0xFF66CCFF)
$brush[2] = _GDIPlus_BrushCreateSolid(0xEE66CCFF)
$brush[3] = _GDIPlus_BrushCreateSolid(0xDD66CCFF)
$brush[4] = _GDIPlus_BrushCreateSolid(0xCC66CCFF)
$brush[5] = _GDIPlus_BrushCreateSolid(0xBB66CCFF)
$brush[6] = _GDIPlus_BrushCreateSolid(0xAA66CCFF)
$brush[7] = _GDIPlus_BrushCreateSolid(0x9966CCFF)
$brush[8] = _GDIPlus_BrushCreateSolid(0x8866CCFF)
$brush[9] = _GDIPlus_BrushCreateSolid(0x7766CCFF)
$brush[10] = _GDIPlus_BrushCreateSolid(0x6666CCFF)
$brush[11] = _GDIPlus_BrushCreateSolid(0x5566CCFF)
$brush[12] = _GDIPlus_BrushCreateSolid(0x4466CCFF)
$brush[13] = _GDIPlus_BrushCreateSolid(0x3366CCFF)
$brush[14] = _GDIPlus_BrushCreateSolid(0x2266CCFF)
$brush[15] = _GDIPlus_BrushCreateSolid(0x1166CCFF)
$graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
$bitmap = _GDIPlus_BitmapCreateFromGraphics(100, 100, $graphic)
$buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
GUISetState()
Do
$msg = GUIGetMsg()
_GDIPlus_GraphicsFillRect($buffer, 0, 0, 100, 100, $brushWeiss)
_GDIPlus_GraphicsFillPie($buffer,0,0,100,100,$startangle,$angle,$brush[$r])
_GDIPlus_GraphicsDrawImageRect($graphic, $bitmap, 0, 0, 100, 100)
Until $msg = -3
Func _EXIT()
_GDIPlus_BrushDispose($brush)
_GDIPlus_BrushDispose($brushWeiss)
_GDIPlus_GraphicsDispose($graphic)
_GDIPlus_GraphicsDispose($buffer)
_GDIPlus_BitmapDispose($bitmap)
_GDIPlus_Shutdown()
EndFunc
Func _bewege()
$startangle += 2
If $angle < 360 Then $angle += 3
If $angle >= 360 Then $angle = 0
;~ ConsoleWrite($angle&@CRLF)
Select
Case $angle < 24
$r = 1
Case $angle >= 24 And $angle < 48
$r = 2
Case $angle >= 48 And $angle < 72
$r = 3
Case $angle >= 72 And $angle < 96
$r = 4
Case $angle >= 96 And $angle < 120
$r = 5
Case $angle >= 120 And $angle < 144
$r = 6
Case $angle >= 144 And $angle < 168
$r = 7
Case $angle >= 168 And $angle < 192
$r = 8
Case $angle >= 192 And $angle < 216
$r = 9
Case $angle >= 216 And $angle < 240
$r = 10
Case $angle >= 240 And $angle < 264
$r = 11
Case $angle >= 264 And $angle < 288
$r = 12
Case $angle >= 288 And $angle < 322
$r = 13
Case $angle >= 322 And $angle < 346
$r = 14
Case $angle >= 346 And $angle < 360
$r = 15
EndSelect
EndFunc
8:
Spoiler anzeigen
#include <GDIPlus.au3>
Global $pi = 3.1415926535898
Global $formel = 1
Global $winkel1 = 0
Global $winkel2 = $pi
Global $x1start=Round(Cos($winkel1)*40 + 40,0)
Global $y1start=Round(Sin($winkel1)*40 + 40,0)
Global $x1=$x1start
Global $y1=$y1start
OnAutoItExitRegister("_EXIT")
AdlibRegister("_bewege",10)
$Gui = GUICreate("",200,100)
_GDIPlus_Startup()
$brushWeiss = _GDIPlus_BrushCreateSolid(0xFFF0F0F0)
$brushGruen = _GDIPlus_BrushCreateSolid(0xFF60CCFF)
$graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
$bitmap = _GDIPlus_BitmapCreateFromGraphics(200, 100, $graphic)
$buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
GUISetState()
Do
$msg = GUIGetMsg()
_GDIPlus_GraphicsFillRect($buffer, 0, 0, 200, 100, $brushWeiss)
_GDIPlus_GraphicsFillEllipse($buffer,$x1,$y1,20,20,$brushGruen)
_GDIPlus_GraphicsDrawImageRect($graphic, $bitmap, 0, 0, 200, 100)
Until $msg = -3
Func _EXIT()
_GDIPlus_BrushDispose($brushGruen)
_GDIPlus_BrushDispose($brushWeiss)
_GDIPlus_GraphicsDispose($graphic)
_GDIPlus_GraphicsDispose($buffer)
_GDIPlus_BitmapDispose($bitmap)
_GDIPlus_Shutdown()
EndFunc
Func _bewege()
If $formel=1 Then
$winkel1 += $pi/30
$x1=Round(Cos($winkel1)*40 + 40,0)
$y1=Round(Sin($winkel1)*40 + 40,0)
Else
$winkel2 -= $pi/30
$x1=Round(Cos($winkel2)*40 + 120,0)
$y1=Round(Sin($winkel2)*40 + 40,0)
EndIf
If $x1 = $x1start And $y1 = $y1start Then $formel = $formel*-1
EndFunc
Regen:
Spoiler anzeigen
#include <GuiConstants.au3>
#include <GDIPlus.au3>
#include <Misc.au3>
Opt("GUIOnEventMode", 1)
$fach = 0
Dim $gegner[80][2]
For $j = 0 To UBound($gegner) - 1 Step 1
$gegner[$j][0] = -100
Next
OnAutoItExitRegister("_EXIT")
$Gui = GUICreate("Regen", 500, 500, 100, 100)
_GDIPlus_Startup()
$brushSchwarz = _GDIPlus_BrushCreateSolid(0xFFABCDEF)
$brushWeiss = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
$graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
$bitmap = _GDIPlus_BitmapCreateFromGraphics(500, 500, $graphic)
$buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
GUISetState()
AdlibRegister("_gegnerSpawn", 50)
GUISetOnEvent(-3,"_ExitMode")
Do
For $m = 0 To UBound($gegner) - 1 Step 1
If $gegner[$m][1] >= 480 Then $gegner[$m][1] = 0
Next
For $k = 0 To UBound($gegner) - 1 Step 1
$gegner[$k][1] += 2
Next
_GDIPlus_GraphicsFillRect($buffer, 0, 0, 500, 500, $brushWeiss)
For $i = 0 To UBound($gegner) - 1 Step 1
_GDIPlus_GraphicsFillEllipse($buffer, $gegner[$i][0], $gegner[$i][1], 20, 20, $brushSchwarz)
Next
_GDIPlus_GraphicsDrawImageRect($graphic, $bitmap, 0, 0, 500, 500)
Until Not 1
Func _EXIT()
_GDIPlus_BrushDispose($brushSchwarz)
_GDIPlus_BrushDispose($brushWeiss)
_GDIPlus_GraphicsDispose($buffer)
_GDIPlus_GraphicsDispose($graphic)
_GDIPlus_Shutdown()
EndFunc ;==>_EXIT
Func _gegnerSpawn()
If $fach <= UBound($gegner) - 2 Then
$gegner[$fach][0] = Random(0, 480, 1)
$fach += 1
$gegner[$fach][1] = 0
EndIf
EndFunc ;==>_gegnerSpawn
Func _ExitMode()
Exit
EndFunc
Ich hoffe es gefällt euch
DFPWare