Hallo Leute
aufgrund von name22's Idee eine UDF hier für zu machen, hab ich es mal für Lade 2 und 3 ausprobiert, jedoch bekomme ich zahlreiche WARNING's wenn ich das script ausführe und Lade2 klappt gar nicht
Lade2:
Spoiler anzeigen
#include <GDIPlus.au3>
OnAutoItExitRegister("_Lade_Shutdown")
$gui = GUICreate("",400,50)
_Lade_Startup($gui,400,50,20)
GUISetState()
AdlibRegister("_Lade_Bewege",10)
Do
$msg = GUIGetMsg()
_Lade_Zeichne()
Until $msg = -3
Func _Lade_Startup($hWnd,$width,$height,$durchmesser)
Global $w = $width
Global $h = $height
Global $d = $durchmesser
Global $x[16]
Global $brush[16]
For $i=1 To 15 Step 1
$x[$i] = 10-(($i-1)*10)
Next
_GDIPlus_Startup()
Global $brushWeiss = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
For $j = 0 To 14 Step 1
$brush[$j+1] = _GDIPlus_BrushCreateSolid("0x" & Hex(0xFF - $j * 0x11, 2) & "60CCFF")
Next
Global $graphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
Global $bitmap = _GDIPlus_BitmapCreateFromGraphics($w, $h, $graphic)
Global $buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
EndFunc
Func _Lade_Shutdown()
For $m = 1 To 15 Step 1
_GDIPlus_BrushDispose($brush[$m])
Next
_GDIPlus_BrushDispose($brushWeiss)
_GDIPlus_GraphicsDispose($graphic)
_GDIPlus_GraphicsDispose($buffer)
_GDIPlus_BitmapDispose($bitmap)
_GDIPlus_Shutdown()
EndFunc
Func _Lade_Bewege()
For $n = 1 To 15 Step 1
If $x[$n] < $w Then $x[$n] += 2
If $x[$n] >= $w Then $x[$n] = 0
Next
EndFunc
Func _Lade_Zeichne()
_GDIPlus_GraphicsFillRect($buffer, 0, 0, $w, $h, $brushWeiss)
For $o = 1 To 15 Step 1
_GDIPlus_GraphicsFillEllipse($buffer,$x[$o],($w-$d)/2,$d,$d,$brush[$o])
Next
_GDIPlus_GraphicsFillRect($buffer,0,0,20,$h,$brushWeiss)
_GDIPlus_GraphicsFillRect($buffer,$w-40,0,20,$h,$brushWeiss)
_GDIPlus_GraphicsDrawImageRect($graphic, $bitmap, 0, 0, $w, $h)
EndFunc
und Lade3:
Spoiler anzeigen
#include <GDIPlus.au3>
OnAutoItExitRegister("Lade_shutdown")
$gui = GUICreate("GUI",100,100)
Lade_startup($gui,100,100)
GUISetState()
AdlibRegister("Lade_bewege",15)
Do
$msg = GUIGetMsg()
Until $msg = -3
Func Lade_bewege()
$startangle += 2
$angle = Mod($angle + 3, 360)
$r = 1 + Floor($angle / 24)
_GDIPlus_GraphicsFillRect($buffer, 0, 0, $w, $h, $brushWeiss)
_GDIPlus_GraphicsFillPie($buffer, 0, 0, $w, $h, $startangle, $angle, $brush[$r])
_GDIPlus_GraphicsDrawImageRect($graphic, $bitmap, 0, 0, $w, $h)
EndFunc
Func Lade_startup($hWnd,$width,$height)
Global $w = $width
Global $h = $height
Global $angle = 1
Global $r = 1
Global $startangle = 0
Global $brush[16]
_GDIPlus_Startup()
Global $brushWeiss = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
For $i = 0 To 14
$brush[$i + 1] = _GDIPlus_BrushCreateSolid("0x" & Hex(0xFF - $i * 0x11, 2) & "66CCFF")
Next
Global $graphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
Global $bitmap = _GDIPlus_BitmapCreateFromGraphics($w, $h, $graphic)
Global $buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
_GDIPlus_GraphicsSetSmoothingMode($buffer, 2)
EndFunc
Func Lade_shutdown()
For $i = 1 To 15
_GDIPlus_BrushDispose($brush[$i])
Next
_GDIPlus_BrushDispose($brushWeiss)
_GDIPlus_GraphicsDispose($graphic)
_GDIPlus_GraphicsDispose($buffer)
_GDIPlus_BitmapDispose($bitmap)
_GDIPlus_Shutdown()
EndFunc
Ich hoffe ihr könnt mir ein paar Tips geben, wie ich das verbessern kann.
Danke
DFPWare