Hi!
ich sitze seit kurzem hier an meiner kleinen (vllt hilfreichen!) UDF dran,
diese erstellt eine Form eines Abgerundetes Rechteck's
UDF selbst
Func _GDIPlus_GraphicsDraw_AbgerundetesRechteck($hGraphics,$iX, $iY, $iWidth, $iHeight,$Pen=0)
If ($iX + $iY) - ($iHeight+$iWidth) < 40 Then
$iHeight += 10
$iWidth += 10
EndIf
_GDIPlus_GraphicsDrawArc($hGraphics,$iX,$iY,30,30,180,90,$Pen) ;25
_GDIPlus_GraphicsDrawArc($hGraphics,$iHeight,$iWidth,30,30,360,90,$Pen) ;25
_GDIPlus_GraphicsDrawArc($hGraphics,$iX,$iWidth,30,30,90,90,$Pen) ;25
_GDIPlus_GraphicsDrawArc($hGraphics,$iHeight,$iY,30,30,270,90,$Pen) ;25
_GDIPlus_GraphicsDrawLine($hGraphics,$iX + 15,$iY,$iHeight+15,$iY,$Pen)
_GDIPlus_GraphicsDrawLine($hGraphics,$iHeight+30,$iX+15,$iHeight+30,$iWidth+15,$Pen)
_GDIPlus_GraphicsDrawLine($hGraphics,$iX+15,$iWidth+30,$iHeight+15,$iWidth+30,$Pen)
_GDIPlus_GraphicsDrawLine($hGraphics,$iX,$iY+15,$iX,$iWidth+15,$Pen)
EndFunc
hier als beispiel:
Beispiel
;~ $X,$Y,$W,$H
$X = InputBox("X","X-Koordinate")
$Y = InputBox("X","Y-Koordinate")
$W = InputBox("X","Breite")
$H = InputBox("X","Höhe")
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
$Form1 = GUICreate("Mein Projekt in GDI+ : AbgerundetesRechteck", 800, 500, 192, 124)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($Form1)
_GDIPlus_GraphicsDraw_AbgerundetesRechteck($hGraphics,$X,$Y,$W,$H)
GUIRegisterMsg(0x000F,"_ReDraw")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
Exit
EndSwitch
WEnd
Func _ReDraw()
_GDIPlus_GraphicsClear($hGraphics,0xF4F4F4)
_GDIPlus_GraphicsDraw_AbgerundetesRechteck($hGraphics,$X,$Y,$W,$H)
EndFunc
Func _GDIPlus_GraphicsDraw_AbgerundetesRechteck($hGraphics,$iX, $iY, $iWidth, $iHeight,$Pen=0)
If ($iX + $iY) - ($iHeight+$iWidth) < 40 Then
$iHeight += 10
$iWidth += 10
EndIf
_GDIPlus_GraphicsDrawArc($hGraphics,$iX,$iY,30,30,180,90,$Pen) ;25
_GDIPlus_GraphicsDrawArc($hGraphics,$iHeight,$iWidth,30,30,360,90,$Pen) ;25
_GDIPlus_GraphicsDrawArc($hGraphics,$iX,$iWidth,30,30,90,90,$Pen) ;25
_GDIPlus_GraphicsDrawArc($hGraphics,$iHeight,$iY,30,30,270,90,$Pen) ;25
_GDIPlus_GraphicsDrawLine($hGraphics,$iX + 15,$iY,$iHeight+15,$iY,$Pen)
_GDIPlus_GraphicsDrawLine($hGraphics,$iHeight+30,$iX+15,$iHeight+30,$iWidth+15,$Pen)
_GDIPlus_GraphicsDrawLine($hGraphics,$iX+15,$iWidth+30,$iHeight+15,$iWidth+30,$Pen)
_GDIPlus_GraphicsDrawLine($hGraphics,$iX,$iY+15,$iX,$iWidth+15,$Pen)
EndFunc
es sind noch ein paar (viele) bugs drin!ich hoffe meine berechnungen der linien etc stimmen so!