iamtheky Posted December 16, 2010 Share Posted December 16, 2010 (edited) Please offer up any suggestions as I am just starting this. This is simply to use the built in behavior of and familiar look of the progresson window, but to set your own progress colors, bar size, and increments. Endgame is to make this a proper function for ease of use purposes. expandcollapse popup#include <Array.au3> $xpos = 100 $ypos = 100 While 1 ProgressOn("Manual Progress", "Drawing your own...", "0 percent" , $xpos , $ypos , 1) $R = 0 $Rcolor = random (0x000000 , 0xFFFFFF) For $P = $xpos + 22 to $xpos + 278 step 2.5 For $D = $ypos + 32 to $ypos + 48 _pixelsetcolor ($P , $D , $Rcolor) sleep (1) If $D = $ypos + 48 Then If $R > 99 Then $R = 99 progressset (0 , $R & ' percent complete') $R += 1 If $R = 90 Then $Rcolor = random (0x000000 , 0xFFFFFF) Endif Next Next progressset (0 , '100 percent complete') sleep (1000) $R = 0 $Rcolor = random (0x000000 , 0xFFFFFF) progressset (0 , $R & ' percent complete') For $D = $ypos + 32 to $ypos + 48 For $P = $xpos + 22 to $xpos + 278 step 2.5 _pixelsetcolor ($P , $D , $Rcolor) sleep (10) If $P > $xpos + 275 Then If $R = 0 Then $R = 6 progressset (0 , $R & ' percent complete') If $R > 99 Then $R = 99 $R += 6 Endif Next Next progressset (0 , '100 percent complete') sleep (1000) For $P = $xpos + 278 to $xpos + 22 step -1 For $D = $ypos + 32 to $ypos + 48 _pixelsetcolor ($P , $D , 0xFFFFFF) If $D = $ypos + 48 Then If $R < 1 Then $R = 1 progressset (0 , 'Rolling Back: ' & $R & ' percent left') $R -= .3 Endif Next Next progressset (0 , '100 percent rolled back') sleep (1000) progressoff () Wend ; Modified from http://www.autoitscript.com/forum/index.php?showtopic=7315&view=findpost&p=178779 Func _PixelSetColor($XCoord, $YCoord, $Color) Local $dc = DllCall("user32.dll", "int", "GetDC", "hwnd", 0) If Not IsArray($dc) Then Return -1 DllCall("gdi32.dll", "long", "SetPixel", "long", $dc[0], "long", $XCoord, "long", $YCoord, "long", _ "0x" & StringRegExpReplace(hex($Color,6), "(..)(..)(..)", "\3\2\1")) ; Change to 0xBBGGRR hex colour format. DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "hwnd", $dc[0]) EndFunc ;==>_PixelSetColor Func _HPSleep($iSleep, $fMs = 1) ; default is milliseconds, otherwise microseconds (1 ms = 1000 µs) If $fMs Then $iSleep *= 1000 ; convert to ms DllCall("ntdll.dll", "dword", "NtDelayExecution", "int", 0, "int64*", -10 * $iSleep) EndFunc Edited December 16, 2010 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
shanet Posted December 16, 2010 Share Posted December 16, 2010 Is this a header file? [font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS: %programfiles%/AutoIt3/autoit3.chm Link to comment Share on other sites More sharing options...
iamtheky Posted December 16, 2010 Author Share Posted December 16, 2010 i dont understand that question? its just three examples of drawing that run in a loop. It was suggested that I make my own GUI so that I do not have redraw/refresh issues, but drawing on one provided is way lazier. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) 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