Hi,
Ich stell hier mal meine eigene Uhr rein.
Ich denke allerdings, dass das nicht die erste ist.
Hoffe aber trotzdem, dass sie gefällt.
Spoiler anzeigen
#include <GDIPlus.au3>
#include <Misc.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode",1)
Opt("MouseCoordMode",2)
Global $iWidth = 200
Global $iHeight = 200
Global $nnx = $iWidth/2
Global $nny = $iHeight/2
Global $aPoints1[5][2]
Global $aPoints2[5][2]
Global $kreisl1 = $iWidth/3
Global $kreisl2 = $iWidth/2.5
Global $rX2 = $iWidth/1.75
Global $rY2 = $iHeight/1.5
Global $rWidth2 = $iWidth/15
Global $rHeight2 = $iHeight/15
Global $rX3 = $iWidth/1.5
Global $rY3 = $iHeight/1.5
Global $rWidth3 = $iWidth/15
Global $rHeight3 = $iHeight/15
Global $rX4 = $iWidth/1.3125
Global $rY4 = $iHeight/1.5
Global $rWidth4 = $iWidth/7.5
Global $rHeight4 = $iHeight/15
WinSetTrans("Uhr","",255)
[/autoit] [autoit][/autoit] [autoit]$hWnd = GUICreate("Physic Engine",$iWidth,$iHeight,-1,-1,$WS_POPUP)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iWidth,$iHeight,$hGraphics)
$hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
$hPenblau = _GDIPlus_PenCreate(0xFF0000FF)
$hPengruen = _GDIPlus_PenCreate(0xFF00FF00)
$hBrushrot = _GDIPlus_BrushCreateSolid(0xFFFF0000)
$hBrushgruen = _GDIPlus_BrushCreateSolid(0xFF00FF00)
$hBrushgrau = _GDIPlus_BrushCreateSolid(0xFF999999)
GUISetOnEvent(-3,"_exit")
[/autoit] [autoit][/autoit] [autoit]AdlibRegister("_menu",10)
[/autoit] [autoit][/autoit] [autoit]While 1
WEnd
Func _menu()
_GDIPlus_GraphicsClear($hBuffer,0xFFFFFFFF)
_punkte()
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsFillRect($hBuffer,$rX2,$rY2,$rWidth2,$rHeight2,$hBrushgrau)
_GDIPlus_GraphicsFillRect($hBuffer,$rX3,$rY3,$rWidth3,$rHeight3,$hBrushgrau)
_GDIPlus_GraphicsFillRect($hBuffer,$rX4,$rY4,$rWidth4,$rHeight4,$hBrushgrau)
_GDIPlus_GraphicsDrawString($hBuffer,@MDAY,$rX2,$rY2 + $iHeight/200,"Arial",$iWidth/30)
_GDIPlus_GraphicsDrawString($hBuffer,@MON,$rX3,$rY3 + $iHeight/200,"Arial",$iWidth/30)
_GDIPlus_GraphicsDrawString($hBuffer,@YEAR,$rX4 + $iWidth/100,$rY4 + $iHeight/200,"Arial",$iWidth/30)
_GDIPlus_GraphicsFillPolygon($hBuffer,$aPoints1)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsFillPolygon($hBuffer,$aPoints2)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawLine($hBuffer,$nnx,$nny,$secx,$secy)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282/12 + 1.5705)*$kreisl1,$nny - Sin(6.282/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282/12 + 1.5705)*$kreisl2,$nny - Sin(6.282/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*2/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*2/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*2/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*2/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*3/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*3/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*3/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*3/12 + 1.5705)*$kreisl2)
;_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*4/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*4/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*4/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*4/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*5/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*5/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*5/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*5/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*6/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*6/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*6/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*6/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*7/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*7/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*7/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*7/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*8/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*8/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*8/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*8/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*9/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*9/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*9/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*9/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*10/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*10/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*10/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*10/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*11/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*11/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*11/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*11/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawLine($hBuffer,$nnx - Cos(6.282*12/12 + 1.5705)*$kreisl1,$nny - Sin(6.282*12/12 + 1.5705)*$kreisl1,$nnx - Cos(6.282*12/12 + 1.5705)*$kreisl2,$nny - Sin(6.282*12/12 + 1.5705)*$kreisl2)
_GDIPlus_GraphicsDrawImageRect($hGraphics,$hBitmap,0,0,$iWidth,$iHeight)
EndFunc
Func _punkte()
Global $sec = @SEC
Global $secl = $iWidth/3 + $iWidth/50
Global $secx = $nnx - Cos(($sec/60)*6.282 + 1.5705)*$secl
Global $secy = $nny - Sin(($sec/60)*6.282 + 1.5705)*$secl
Global $min = @MIN
Global $minl = $iWidth/3
Global $minx = $nnx - Cos(($min/60)*6.282 + 1.5705)*$minl
Global $miny = $nny - Sin(($min/60)*6.282 + 1.5705)*$minl
Global $hour = @HOUR
Global $stdl = $iWidth/5
Global $stdx = $nnx - Cos((($hour/12)*6.282 + 1.5705)+(($min/60)*0.5235))*$stdl
Global $stdy = $nny - Sin((($hour/12)*6.282 + 1.5705)+(($min/60)*0.5235))*$stdl
$aPoints1[0][0] = 4
[/autoit] [autoit][/autoit] [autoit]$aPoints1[1][0] = $stdx
$aPoints1[1][1] = $stdy
$aPoints1[2][0] = $nnx - Cos((($hour/12)*6.282 + 3.141)+(($min/60)*0.5235))*$stdl/10
$aPoints1[2][1] = $nny - Sin((($hour/12)*6.282 + 3.141)+(($min/60)*0.5235))*$stdl/10
$aPoints1[3][0] = $nnx - Cos((($hour/12)*6.282 + 4.7115)+(($min/60)*0.5235))*$stdl/10
$aPoints1[3][1] = $nny - Sin((($hour/12)*6.282 + 4.7115)+(($min/60)*0.5235))*$stdl/10
$aPoints1[4][0] = $nnx - Cos((($hour/12)*6.282)+(($min/60)*0.5235))*$stdl/10
$aPoints1[4][1] = $nny - Sin((($hour/12)*6.282)+(($min/60)*0.5235))*$stdl/10
$aPoints2[0][0] = 4
[/autoit] [autoit][/autoit] [autoit]$aPoints2[1][0] = $minx
$aPoints2[1][1] = $miny
$aPoints2[2][0] = $nnx - Cos(($min/60)*6.282 + 3.141)*$minl/(50/3)
$aPoints2[2][1] = $nny - Sin(($min/60)*6.282 + 3.141)*$minl/(50/3)
$aPoints2[3][0] = $nnx - Cos(($min/60)*6.282 + 4.7115)*$minl/(50/3)
$aPoints2[3][1] = $nny - Sin(($min/60)*6.282 + 4.7115)*$minl/(50/3)
$aPoints2[4][0] = $nnx - Cos(($min/60)*6.282)*$minl/(50/3)
$aPoints2[4][1] = $nny - Sin(($min/60)*6.282)*$minl/(50/3)
EndFunc
Func _exit()
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_GraphicsDispose($hBuffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_PenDispose($hPenblau)
_GDIPlus_PenDispose($hPengruen)
_GDIPlus_BrushDispose($hBrushrot)
_GDIPlus_BrushDispose($hBrushgruen)
_GDIPlus_BrushDispose($hBrushgrau)
_GDIPlus_Shutdown()
Exit
EndFunc