Ich habe folgendes Problem:
Ich hab ein Rechteck indem sich ein Kreis und drei Linien befinden.
Nun will ich das ganze rotieren, bekomm das aber nicht hin.
Script:
Spoiler anzeigen
#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]Global $hWnd
Global $hGraphic, $bitmap, $backbuffer, $pen, $brush
Global $x = 250, _
$y = 250, _
$rotation = 180, _
$pi = 4 * ATan(1)
$hWnd = GUICreate("Rotation", 500, 500, -1, -1)
GUISetOnEvent(-3, "_Close")
GUISetState()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hwnd)
$bitmap = _GDIPlus_BitmapCreateFromGraphics(500, 500, $hGraphic)
$backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
$pen = _GDIPlus_PenCreate(0, 1)
$brush = _GDIPlus_BrushCreateSolid(0xFF00FF00)
While 1
_GDIPlus_GraphicsFillRect($backbuffer, 0, 0, 500, 500, $brush)
_GDIPlus_PenSetColor($pen, 0xFFFF0000)
; Berechnung für die Koordinaten
$x1 = $x - 5
$y1 = $y + 10
$x2 = $x - 5
$y2 = $y - 10
$x3 = $x + 5
$y3 = $y - 10
$x4 = $x + 5
$y4 = $y + 10
; Ende der Berechnungen
_GDIPlus_GraphicsDrawLine($backbuffer, $x1, $y1, $x2, $y2, $pen)
_GDIPlus_GraphicsDrawLine($backbuffer, $x2, $y2, $x3, $y3, $pen)
_GDIPlus_GraphicsDrawLine($backbuffer, $x3, $y3, $x4, $y4, $pen)
_GDIPlus_GraphicsDrawLine($backbuffer, $x4, $y4, $x1, $y1, $pen)
_GDIPlus_GraphicsDrawEllipse($backbuffer, $x - 3, $y -3, 6, 6, $pen)
_GDIPlus_GraphicsDrawLine($backbuffer, $x, $y - 3, $x, $y - 13, $pen)
_GDIPlus_PenSetColor($pen, 0xFF0000FF)
_GDIPlus_GraphicsDrawLine($backbuffer, $x - 3, $y - 10, $x - 3, $y - 8, $pen)
_GDIPlus_GraphicsDrawLine($backbuffer, $x + 3, $y - 10, $x + 3, $y - 8, $pen)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $bitmap, 0, 0, 500, 500)
Sleep(10)
WEnd
Func _Close()
_GDIPlus_BrushDispose($brush)
_GDIPlus_PenDispose($pen)
_GDIPlus_GraphicsDispose($backbuffer)
_GDIPlus_BitmapDispose($bitmap)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
WinClose($hwnd)
Exit
EndFunc
Danke schonmal für die Antworten.
MfG
H2112