Hallo allerseits!
Ich frage mich, ob jemand den Dreh raus hat, um mir hierbei zu helfen: ![]()
Spoiler anzeigen
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]Global $Gui = GUICreate("Labyrinths-Frontend", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUISetBkColor(0xFFFFFF)
GUISetState()
_GDIPlus_Startup()
Global $HGraphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
For $i = 0 To 360
_Draw($i)
Sleep(1000)
Next
While 1
Sleep(1000)
WEnd
Func _Exit()
_GDIPlus_GraphicsDispose($HGraphic)
_GDIPlus_Shutdown()
Exit
EndFunc
Func _Draw($_iAngle)
_GDIPlus_GraphicsClear($HGraphic, 0xFFFFFFFF)
Local $iHyp = 200
Local $iDeltaX = $iHyp * sin(- $_iAngle)
Local $iDeltaY = $iHyp * cos(- $_iAngle)
Local $iCenterX = Round(@DesktopWidth / 2, 0)
Local $iCenterY = Round(@DesktopHeight / 2, 0)
_GDIPlus_GraphicsDrawLine($HGraphic, $iCenterX - $iDeltaX, $iCenterY - $iDeltaY, $iCenterX + $iDeltaX, $iCenterY + $iDeltaY)
EndFunc
Die Linie soll sich drehen, und zwar Grad für Grad. Leider tut sie das nicht - was mache ich falsch? $iHyp gibt die Hälfte der Länge von der Linie an und bildet die Hypothenuse für Sinus und Cosinus.
Vielen Dank bereits im Voraus,
Matthias