9月142023
有点意思的代码-画个五角星
;================================= * = * = * = * = * = * ===========================================================
#NoTrayIcon
SRandom(@AutoItPID)
WinMinimizeAll ()
HotKeySet("{ESC}", "OntSnap"); == * * * == To stop the program
$lengte = 450
Dim $x0ne, $yone, $xtwo, $ytwo, $line, $Slaap, $LineColor, $LineWidth
While "Creating the Stars"
$Slaap = Random(1, 1000, 1)
$lengte = Random(50, 450, 1)
$LineWidth = Random(2, 20, 1)
$x0ne = Random(10, @DesktopWidth - $lengte / 3, 1)
Sleep($Slaap)
$yone = Random(-1, @DesktopHeight - $lengte / 3, 1)
$xtwo = $x0ne + $lengte * .328
$ytwo = $yone + $lengte * .955
$LineColor = Random(0x000000, 0xFFFFFF, 1)
DrawALine()
$x0ne = $x0ne - $lengte * .507
$yone = $yone + $lengte * .373
Sleep($Slaap)
DrawALine()
$xtwo = $xtwo + $lengte * .164
$ytwo = $ytwo - $lengte * .582
Sleep($Slaap)
DrawALine()
$x0ne = $x0ne + $lengte * .179
$yone = $yone + $lengte * .582
Sleep($Slaap)
DrawALine()
$xtwo = $xtwo - $lengte * .492
$ytwo = $ytwo - $lengte * .373
Sleep($Slaap)
DrawALine()
Sleep($Slaap)
WEnd
Func DrawALine()
$hnd = DllCall("user32.dll", "int", "GetDC", "hwnd", 0)
$pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0, "int", $LineWidth, "int", $LineColor)
DllCall("gdi32.dll", "int", "SelectObject", "int", $hnd[0], "int", $pen[0])
DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hnd[0], "int", $x0ne, "int", $yone, "int", 0)
DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hnd[0], "int", $xtwo, "int", $ytwo)
DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "int", $hnd[0])
EndFunc ;==>DrawALine
Func OntSnap()
WinMinimizeAllUndo ( )
Exit
EndFunc ;==>OntSnap
;================================= * = * = * = * = * = * ===========================================================
扫描二维码,在手机上阅读
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!