Hallo,
ich habe gerade einen Script geschrieben. Es erstellt eine GUI mit einem Punkt in der Mitte. Vom Punkt aus sollen dann Striche bis zum Rand gezogen werden und das einmal ganz rundherum.
Doch irgendwie macht der nur 1/4 statt alles. Woran kann das genau liegen? Ich blicke da nicht mehr ganz durch :wacko:
Code:
Spoiler anzeigen
#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.0.0
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#include <GDIPlus.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
Global $index, $hPen
Global $x1, $y1, $x2, $y2
Global Const $Pi = 4 * ATan(1)
Global $radians = 180 * 2.50
Global $x = 1024
Global $i
$GUI_Handle = GUICreate("GDI+", 1024, 768)
GUISetBkColor(0x000000)
GUISetState(@SW_SHOW)
$hWnd = WinGetHandle($GUI_Handle)
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
_GDIPlus_GraphicsSetSmoothingMode($hGraphic, 4) ; AntiAlias
Line_Color()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Quit()
EndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawLine($hGraphic, $x1, $y1, $x2, $y2, $hPen) ;draw line
_GDIPlus_PenDispose($hPen)
_Test()
Line_Color()
$i += 1
[/autoit] [autoit][/autoit] [autoit];~ Sleep(10)
WEnd
Func _Test()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$x1 = 1024 / 2
$y1 = 768 / 2
$x2 = $i
$y2 = 0
TrayTip("", $x2, 5, 1)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]EndFunc ;==>_Test
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func Line_Color() ;thanks to monoceres for the code
Local $RedM = 1, $BlueM = 1.25, $GreenM = 1.50
$index += 0.0075
$color = "0x2F" & Hex(255 * ((Sin($index * $RedM) + 1) / 2), 2) & Hex(255 * ((Sin($index * $GreenM) + 1) / 2), 2) & Hex(255 * ((Sin($index * $BlueM) + 1) / 2), 2)
$hPen = _GDIPlus_PenCreate($color)
EndFunc ;==>Line_Color
Func Quit() ; exit program
_GDIPlus_PenDispose($hPen)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>Quit