JoHanatCent Posted December 21, 2010 Share Posted December 21, 2010 Created because: * Wanted to see if I can * Can I use percentadges to control size? * Visualization of the Random function * Wanted to see if this can waist other peoples time as well * See some reaction from other users. expandcollapse popup;================================= * = * = * = * = * = * =========================================================== #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 ;================================= * = * = * = * = * = * =========================================================== Link to comment Share on other sites More sharing options...
wakillon Posted December 21, 2010 Share Posted December 21, 2010 It's funny ! That's a lot of beautiful stars for the holidays of year-end ! Thanks. AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
JoHanatCent Posted December 22, 2010 Author Share Posted December 22, 2010 @wakillon - You are welcome. @least I could bring joy to one person this year. Link to comment Share on other sites More sharing options...
firecloud Posted December 23, 2010 Share Posted December 23, 2010 Thanks. For me, it's a quite good example to start learning "DllCall" & "DC". Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now