Ich glaube ihr denkt zu kompliziert! Ein Dreieck hat 3 Ecken und auf einen Kreis transferiert bedeutet dies, dass alle 120° eine Ecke vom Dreick ist!
Die x Koordinate kann man über Cos(Grad * Pi /180) * Radius bzw. y Koordinate Sin(Grad * Pi /180) * Radius berechnen.
Für das Dreickeck bedeutet dies 3 Punkte jeweils mit 120° Differenz!
Beispiel:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <GDIPlus.au3>
Local Const $width = 800
Local Const $height = 800
Local $hGraphics, $hBackbuffer, $hBitmap, $hPen, $i, $pi_div_180 = 4 * ATan(1) / 180
Local $w_h = $width * 0.5, $h_h = $height * 0.5
Local $radius_x = $w_h, $radius_y = $h_h
Local $p1_x, $p1_y, $p2_x, $p2_y, $p3_x, $p3_y
Local $title = "GDI+ Beispiel von UEZ"
Opt("GUIOnEventMode", 1)
$hwnd = GUICreate($title, $width, $height, -1, -1, BitOR($WS_SYSMENU,$WS_DLGFRAME,$WS_POPUP))
GUISetOnEvent($GUI_EVENT_CLOSE, "close")
GUISetState()
If @OSBuild < 7600 Then WinSetTrans($hwnd,"", 0xFF)
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphics)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)
$hPen = _GDIPlus_PenCreate(0xFFFFFFFF, 2)
Do
_GDIPlus_GraphicsClear($hBackbuffer)
$p1_x = $w_h + Cos($i * $pi_div_180) * $radius_x ;x Koordinate vom 1. Punkt
$p1_y = $h_h + Sin($i * $pi_div_180) * $radius_y ;y Koordinate vom 1. Punkt
$p2_x = $w_h + Cos(($i + 120) * $pi_div_180) * $radius_x ;x Koordinate vom 2. Punkt
$p2_y = $h_h + Sin(($i + 120) * $pi_div_180) * $radius_y ;y Koordinate vom 2. Punkt
$p3_x = $w_h + Cos(($i + 240) * $pi_div_180) * $radius_x ;x Koordinate vom 3. Punkt
$p3_y = $h_h + Sin(($i + 240)* $pi_div_180) * $radius_y ;y Koordinate vom 3. Punkt
_GDIPlus_GraphicsDrawLine($hBackbuffer, $p1_x, $p1_y, $p2_x, $p2_y, $hPen) ;verbinde p1-p2
_GDIPlus_GraphicsDrawLine($hBackbuffer, $p2_x, $p2_y, $p3_x, $p3_y, $hPen) ;verbinde p2-p3
_GDIPlus_GraphicsDrawLine($hBackbuffer, $p3_x, $p3_y, $p1_x, $p1_y, $hPen) ;verbinde p3-p1
_GDIPlus_GraphicsDrawEllipse($hBackbuffer, $w_h - $radius_x / 2, $h_h - $radius_y / 2, $radius_x, $radius_y, $hPen) ;innerer Kreis
_GDIPlus_GraphicsDrawEllipse($hBackbuffer, 0, 0, 2 * $radius_x, 2 * $radius_y, $hPen) ;äußerer Kreis
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $width, $height)
$i += 2
If $i = 360 Then $i = 0
Sleep(30)
Until False
Func close()
_GDIPlus_PenDispose($hPen)
_GDIPlus_GraphicsDispose($hBackbuffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
Exit
EndFunc
Ich hofffe, dass ich es erklären konnte!
Gruß,
UEZ