Jump to content

wakillon

Active Members
  • Posts

    3,267
  • Joined

  • Last visited

  • Days Won

    23

Reputation Activity

  1. Like
    wakillon got a reaction from balgur in How to create a countdown timer in autoit?   
    An example :


    #include <WindowsConstants.au3> Global $SS_CENTER, $_CompteArebour = 60000, $_Minutes, $_Seconds $_GuiCountDown = GUICreate ( "CountDown...", 500, 200, @DesktopWidth/2 -250, @DesktopHeight/2 -100, $WS_EX_TOPMOST ) GUISetBkColor ( 0xFFFF00 ) $TimeLabel = GUICtrlCreateLabel ( "", 35, -10, 480, 180, $SS_CENTER ) GUICtrlSetFont ( -1, 125, 800 ) GUISetState ( ) WinSetOnTop ( $_GuiCountDown, "", 1 ) $TimeTicks = TimerInit ( ) While 1 _Check ( ) Sleep ( 200 ) WEnd Func _Check ( ) $_CompteArebour -= TimerDiff ( $TimeTicks ) $TimeTicks = TimerInit ( ) Local $_MinCalc = Int ( $_CompteArebour / ( 60 * 1000 ) ), $_SecCalc = $_CompteArebour - ( $_MinCalc * 60 * 1000 ) $_SecCalc = Int ( $_SecCalc / 1000 ) If $_MinCalc <= 0 And $_SecCalc <= 0 Then GUISetBkColor ( 0xFF0000, $_GuiCountDown ) GUICtrlSetData ( $TimeLabel, "Bye !" ) Sleep ( 1000 ) ; If @Compiled Then Shutdown ( 13 ) Exit Else If $_MinCalc <> $_Minutes Or $_SecCalc <> $_Seconds Then $_Minutes = $_MinCalc $_Seconds = $_SecCalc GUICtrlSetData ( $TimeLabel, StringFormat ( "%02u" & ":" & "%02u", $_Minutes, $_Seconds ) ) If $_Minutes = 0 And $_Seconds <= 10 Then Beep ( 1200, 100 ) GUISetBkColor ( 0xA093FF, $_GuiCountDown ) EndIf EndIf EndIf EndFunc ;==> _Check ( )
  2. Haha
    wakillon got a reaction from Scorpys in Test for Window Responsiveness   
    Sorry you're right !
    Hey guys stop using udfs, it's so gigantic !
  3. Like
    wakillon got a reaction from Parsix in BinaryToAu3Kompressor v1.0.5.4 Update of 10 Oct 2014   
    BinaryToAu3Kompressor v1.0.5.4
     

     
    It's now possible to see the best compression ratio using LZMA, LZNT and Base64 compressions with differents combinations.
    Nothing too complicate, you drag'n drop a file on the picture and script Test all compression types and return the ratios.
    ( Test duration depends of file size, slowest compression is LZNT, but all decompressions are fast  )
    Free to you after, to choose the compression(s) you want...
    Yes, LZMA needs a dll ( embedded & compressed in script ) but brings a powerfull compression. 
    It opens scite with your file compressed to an au3 script with or without decompression function as you want.
    Hold Left Shift key when clicking button for just copy script to clipboard.
    Use the 3 compressions at a time works but doesn't give a good ratio, that's why i don't display it.
    Usefull for little files you want include in your scripts !
    No externals files needed, they are already in script.
    Previous downloads : 1103
    Source and Executable
    BinaryToAu3Kompressor will be added to the next version of >SciTEHopper
    Thanks to Ward for his >Base64.au3 and LZMA.au3, and trancexx for his >LZNT functions and his >Base64Decode function.
  4. Like
    wakillon got a reaction from Parsix in Water Effects   
    Browsing a Chinese AutoIt forum, i fall on a little pearl that i want to share with you !
    I have already seen water effects example with autoit, but this one is very easy to create using waterctrl.dll
    Only BMP are supported.
    Position of Blob water can be set by coordinates and mouse movements (and clicks) when over bmp create traces on water.

    All files are embeded in script with BinaryToAu3Kompressor.
    WaterEffect.au3
    Hope you like it !

  5. Like
    wakillon got a reaction from Alan72104 in Bitmap2AscII   
    Bitmap2AscII use Lucida Console font with a size set to 8, so Windows 8/8.1 users need to change their notepad font and size for get a correct display.
    Image Rescale slider is only available when saving as image.
    A click on the "PreviewEdit" open AscII string in Notepad.
    You can save as Text, Html or Image (add the extension you want)
    Each setting change is immediately applied.
     
    Downloads available in the download section
     
    Hope you like it ! 
     
  6. Thanks
    wakillon got a reaction from sulfur in open text files with notepad   
    you forget the space after notepad !
    Try Run ( "notepad.exe " & $sTextFile, @WindowsDir, @SW_MAXIMIZE )
  7. Like
    wakillon got a reaction from robertocm in SpecialCharactersViewer v1.0.1.0   
    I do not like Charmap, it's too small and you can't test a character with another font, you only get all chars for each font so it's not very handy.

    SpecialCharactersViewer permit with the Segoe UI Symbol font to display a maximum ( not all! ) of  Ascii and Unicode characters.
    Simple click on a char and the corresponding Chr or ChrW code is displayed. 
    Free to you to choose another font for see if the selected character can be used with.
    Windows XP do not have Segoe UI Symbol font, so it's more for Win7/Win8 users...
    Previous downloads : 100
    Source : SpecialCharactersViewer v1.0.1.0.au3
    Executable : SpecialCharactersViewer.exe.html
    (Once this html file downloaded, double click on it for start the download)
     
    Will be added to the next version of SciTE Hopper.
    Hope it can help ! 
  8. Like
    wakillon got a reaction from Xandy in SDL2 Firework   
    A little try with SDL 2 Library, SDL 2 GFX and Sid music.
    As usual, no externals files needed.
    Press "Esc" for quit.
    SDL2_Fireworks.au3
    Happy New Year 2017 
  9. Like
    wakillon got a reaction from user4157124 in Bitmap2AscII   
    Bitmap2AscII use Lucida Console font with a size set to 8, so Windows 8/8.1 users need to change their notepad font and size for get a correct display.
    Image Rescale slider is only available when saving as image.
    A click on the "PreviewEdit" open AscII string in Notepad.
    You can save as Text, Html or Image (add the extension you want)
    Each setting change is immediately applied.
     
    Downloads available in the download section
     
    Hope you like it ! 
     
  10. Like
    wakillon got a reaction from argumentum in TinyBrightnessControler v 1.0.0.2   
    It's late and Screen brightness hurts your eyes
    and you do not remember how you can regulate it ?

    I get a solution !

    TinyBrightnessControler

    Left click on Tray Icon for show Controler and Right click for Tray Menu, that's all !


    #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=Electric bulb1.ico #AutoIt3Wrapper_outfile=TinyBrightnessControler.exe #AutoIt3Wrapper_Res_Description=Adjust Screen Brightness #AutoIt3Wrapper_Res_Fileversion=1.0.0.2 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p #AutoIt3Wrapper_Res_LegalCopyright=Copyright 2011 wakillon #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer% #AutoIt3Wrapper_Res_Field=Compile date|%longdate% %time% #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ----------------------------------------------------------------------------------------------------------- AutoIt Version : 3.3.6.1 Author : wakillon Based on the noctis Post : http://autoit.de/index.php?page=Thread&postID=83474#post83474 Title : TinyBrightnessControler Script Fonction : Adjust Screen Brightness. Left click on Tray Icon for show Controler and Right click for Tray Menu. #ce ----------------------------------------------------------------------------------------------------------- #include <WindowsConstants.au3> #include <GuiSlider.au3> Opt ( "TrayOnEventMode", 1 ) Opt ( "TrayMenuMode", 1 ) OnAutoItExitRegister ( "_Exit" ) Global Const $TRAY_UNCHECKED = 4 Global Const $TRAY_EVENT_PRIMARYDOWN = -7 Global $_Rgb, $_DefaultItem, $_GetPosOld, $_AboutItem, $_TitleItem, $_UpdateItem, $_SaveItem Global $_Gui, $_Slider, $_Label1, $_Label2, $_Dll Global $_Version = _GetScriptVersion ( ) _TrayMenu ( ) $_Rgb = RegRead ( "HKEY_LOCAL_MACHINESoftwareTBC", "Gamma" ) If $_Rgb = '' Then $_Rgb =128 $_GetPosOld=$_Rgb _SetGamma ( $_Rgb, $_Rgb, $_Rgb ) While 1 Sleep ( 10 ) WEnd Func _DisplaySlider ( ) Local $_MousePos = MouseGetPos ( ) Local $_GuiWight= 50, $_GuiHeight=230 Local $_Gui = GUICreate ( "", $_GuiWight, $_GuiHeight, $_MousePos[0]-$_GuiWight/2, @DesktopHeight - $_GuiHeight - _GetTaskbarHeight ( ) -2, _ BitOR ( $WS_POPUP, $WS_BORDER ), $WS_EX_TOPMOST, WinGetHandle ( AutoItWinGetTitle ( ) ) ) $_Label1 = GUICtrlCreateLabel ( "Min", 15, 10 ) $_Slider = GUICtrlCreateSlider ( 15, 30, 20, 180, BitOR ( $TBS_VERT, $TBS_TOOLTIPS, $TBS_AUTOTICKS ) ) GUICtrlSetLimit ( -1, 256, 0 ) $_Label2 = GUICtrlCreateLabel ( "Max", 15, 210 ) GUISetState ( ) _GUICtrlSlider_SetPos ( $_Slider, $_GetPosOld ) $_TimerInit = TimerInit ( ) While 1 $_GetPos = _GUICtrlSlider_GetPos ( $_Slider ) If $_GetPos <> $_GetPosOld Then $_Rgb = $_GetPos _SetGamma ( $_Rgb, $_Rgb, $_Rgb ) $_GetPosOld = $_GetPos $_TimerInit = TimerInit ( ) EndIf If _IsMouseOverCtrls ( $_Gui ) Then $_TimerInit = TimerInit ( ) $_TimerDiff = Round ( TimerDiff ( $_TimerInit )/ 1000 ) If $_TimerDiff > 2 Then ExitLoop WEnd GUIDelete ( ) EndFunc ;==> _DisplaySlider ( ) Func _IsMouseOverCtrls ( $_GuiHwnd, $_Active=0 ) $_CursorInfo = GUIGetCursorInfo ( $_GuiHwnd ) If Not @error Then Switch $_CursorInfo[4] Case $_Slider, $_Label1, $_Label2 Return 1 EndSwitch EndIf EndFunc ;==> _IsMouseOverCtrls ( ) Func _Normal ( ) TrayItemSetState ( $_DefaultItem, $TRAY_UNCHECKED ) $_Rgb = 128 $_GetPosOld = 128 _SetGamma ( $_Rgb, $_Rgb, $_Rgb ) EndFunc ;==> _Normal ( ) Func _Exit ( ) DllClose ( $_Dll ) Exit EndFunc ;==> _Exit ( ) Func _SetGamma ( $vRed=128, $vGreen=128, $vBlue=128 ) Local $n_ramp, $rVar, $gVar, $bVar, $Ret, $i, $dc If $vRed < 0 Or $vRed > 386 Then Return -1 If $vGreen < 0 Or $vGreen > 386 Then Return -1 If $vBlue < 0 Or $vBlue > 386 Then Return -1 $dc = DLLCall ( "user32.dll", "int", "GetDC","hwnd", 0 ) $n_ramp = DllStructCreate ( "short[" & ( 256*3 ) & "]" ) For $i = 0 to 256 $rVar = $i * ( $vRed + 128 ) If $rVar > 65535 Then $rVar = 65535 $gVar = $i * ( $vGreen + 128 ) If $gVar > 65535 Then $gVar = 65535 $bVar = $i * ( $vBlue + 128 ) If $bVar > 65535 Then $bVar = 65535 DllStructSetData ( $n_ramp, 1, Int ( $rVar ), $i ) ; red DllStructSetData ( $n_ramp, 1, Int ( $gVar ), $i+256 ) ; green DllStructSetData ( $n_ramp, 1, Int ( $bVar ), $i+512 ) ; blue Next $ret = DLLCall ( "gdi32.dll", "int", "SetDeviceGammaRamp", "int", $dc[0], "ptr", DllStructGetPtr ( $n_Ramp ) ) $dc = 0 $n_Ramp = 0 EndFunc ;==> _SetGamma ( ) Func _TrayMenu ( ) $_TempDir = @TempDir & 'TBCskin' If Not FileExists ( $_TempDir ) Then DirCreate ( $_TempDir ) If Not FileExists ( $_TempDir & 'Electric bulb1.ico' ) Then _ InetGet ( 'http://tinyurl.com/d3srkot', $_TempDir & 'Electric bulb1.ico', 9, 0 ) TraySetToolTip ( $_Version & @CRLF & @CRLF & '* Left click for show Controler' & @CRLF & '* Right click for Tray Menu' & @CRLF ) TraySetIcon ( $_TempDir & 'Electric bulb1.ico' ) TraySetClick ( 16 ) TraySetOnEvent ( $TRAY_EVENT_PRIMARYDOWN, '_DisplaySlider' ) $_TitleItem = TrayCreateItem ( $_Version ) TrayItemSetOnEvent ( -1, '_UnCheck' ) TrayCreateItem ( '' ) $_DefaultItem = TrayCreateItem ( 'Set Brightness To Normal' ) TrayItemSetOnEvent ( -1, '_Normal' ) TrayCreateItem ( '' ) $_UpdateItem = TrayCreateItem ( "See For Update" ) TrayItemSetOnEvent ( -1, '_SeeForUpdate' ) TrayCreateItem ( "" ) $_AboutItem = TrayCreateItem ( "About" ) TrayItemSetOnEvent ( -1, '_About' ) TrayCreateItem ( "" ) $_SaveItem = TrayCreateItem ( "Save Settings" ) TrayItemSetOnEvent ( -1, '_Save' ) TrayCreateItem ( "" ) $_ExitItem = TrayCreateItem ( 'Exit' ) TrayItemSetOnEvent ( -1, '_Exit' ) TraySetState ( 4 ) EndFunc ;==> _TrayMenu ( ) Func _Save ( ) TrayItemSetState ( $_SaveItem , $TRAY_UNCHECKED ) RegWrite ( "HKEY_LOCAL_MACHINESoftwareTBC", "Gamma", "REG_SZ", $_Rgb ) Msgbox ( 262144+4160, "Saved", "Gamma Settings have been saved", 3 ) EndFunc Func _SeeForUpdate ( ) TrayItemSetState ( $_UpdateItem , $TRAY_UNCHECKED ) ShellExecute ( 'http://www.autoitscript.com/forum/topic/127668-tinybrightnesscontroler/' ) EndFunc ;==> _SeeForUpdate ( ) Func _UnCheck ( ) TrayItemSetState ( $_TitleItem , $TRAY_UNCHECKED ) EndFunc ;==> _UnCheck ( ) Func _GetScriptVersion ( ) If Not @Compiled Then Return StringTrimRight ( @ScriptName, 4 ) & ' © wakillon 2010 - 2011' Else Return StringTrimRight ( @ScriptName, 4 ) & ' v' & FileGetVersion ( @ScriptFullPath ) & ' © wakillon 2010 - 2011' EndIf EndFunc ;==> _GetScriptVersion ( ) Func _About ( ) TrayItemSetState ( $_AboutItem , $TRAY_UNCHECKED ) Msgbox ( 262144+4160, "About : ", $_Version & @CRLF & @CRLF & "April 2011" & @CRLF & @CRLF & "Based on the noctis's Gamma Topic on AutoIt.de" & @CRLF & @CRLF & "wakillon." & @CRLF & " " ) EndFunc ;==> _About ( ) Func _GetTaskbarHeight ( ) $_OptOld = Opt ( "WinTitleMatchMode", 4 ) $_WinPos = WinGetPos ( "classname=Shell_TrayWnd" ) If @error Then Return -1 Opt ( "WinTitleMatchMode", $_OptOld ) Return $_WinPos[3] EndFunc ;==> _GetTaskbarHeight ( )
    Scripts and executables with full embeded files are available on GoogleCode, see link in my sig.

    Comments are welcome !

    All this time spent in front of the screen, remember to protect your eyes !
  11. Like
    wakillon got a reaction from Fabse in Water Effects   
    Browsing a Chinese AutoIt forum, i fall on a little pearl that i want to share with you !
    I have already seen water effects example with autoit, but this one is very easy to create using waterctrl.dll
    Only BMP are supported.
    Position of Blob water can be set by coordinates and mouse movements (and clicks) when over bmp create traces on water.

    All files are embeded in script with BinaryToAu3Kompressor.
    WaterEffect.au3
    Hope you like it !

  12. Like
    wakillon got a reaction from robertocm in Puzzle Game v1.0.1.4   
    Puzzle Game v1.0.1.4

     
    Just for Fun, a tiny Puzzle game using >ImageSplitter functions !
    Load any image by menu or by drag&drop (jpg, gif, png and bmp are supported)
    Choose the Pieces number you want.
    No sliding piece, just move Puzzle pieces where you want by drag&drop as a real puzzle.
    Sounds indicate if well or misplaced.
    Buttons were made online with chimply.com the easy and free buttons generator !
    Compatible with AutoIt 3.3.8.1, 3.3.10.2 and Beta 3.3.11.4 Versions.
    Previous downloads : 67
    Downloads available in the download section
     
    Have fun ! 
  13. Like
    wakillon got a reaction from AnonymousX in Set default on checkbox as checked?   
    have you try guictrlsetstate ( $checkCN, $GUI_CHECKED ) ?
  14. Like
    wakillon reacted to Melba23 in Is AutoIt still being developed?   
    Hi,
    Enough of flogging the same old horse - it never, ever comes back to life. For the umpteenth time:
    AutoIt is Jon's project and the release of any new version depends on his willingness to take time away from getting food on his table and a roof over his head to do the required development work - just remind yourself that he makes absolutely nothing from you and all the others who use Autoit. The whole AutoIt project is a hobby for the non-existent "AutoIt coding team" and those of us who do help out both here in the forum and as core UDF maintainers do so as volunteers solely for the pleasure of helping others. If you want an IDE, debugger, etc then go ahead and code it yourself - or pay someone else to do so - as there is zero chance of seeing "official" versions. Thread closed. As indeed will be any future ones on this subject - because they all end up the same way with people demanding that their own personal coding requirements are provided free of charge by others.
    M23
  15. Like
    wakillon got a reaction from argumentum in SciTE Hopper v1.0.5.7 : Jump to any line by one click ! Update of 07 Dec 2017   
    You are right, download links are dead due to dropbox updates
    So you can now get the last version in the AutoIt download section
    Thanks 
    In this last version Au3FileSearch is replaced by StringFinder
  16. Like
    wakillon reacted to t0nZ in SciTE Hopper v1.0.5.7 : Jump to any line by one click ! Update of 07 Dec 2017   
    Only to inform you: the links of version 1.0.5.6 are no longer working.
    I never found something better than  scite hopper, so moving to a newer machine I managed to save the scitehopper.exe to reinstall it.
    But it would be nice to have SciteHopper downloadable, also with google I found only outdated versions.
    Cheers,
  17. Like
    wakillon got a reaction from xan in Fifteen Game Autoit   
    Good work
    Thanks

  18. Like
    wakillon reacted to Gianni in TSP art generator   
    After reading this page, (http://www.drububu.com/illustration/tsp/index.html) I was curious and I put together this script.
    it is not a "stand alone" script, as it uses some third parties programs*, but in few steps it acomplish the conversion to the TSP art. The generated images are quite nice, but you have to try more attempts to find the right combinations of parameters for different source images. Best results can easily obtained with schematic black and wite images. Drag and drop for example something like in this link.
    Also, set the "Variable thickness line" option and try with the image at this link for another example: (https://images.fineartamerica.com/images/artworkimages/mediumlarge/1/david-michelangelo-murphy-elliott.jpg)
    Since used programs generate also some temporay files, please save this script and the dependencies into a single folder so to avoid the scattering of files around and also allowing the main script to find the needed programs.
    Example of an TSP art generated with this script and related programs (the image on the left is converted in the image on the right) just drag and drop images on the GUI of the script and all is done automatically.

    * Here are the links to download the needed "dependencies": ( just put all the stuff in a single folder along with the script.)
    voronoi.exe http://www.drububu.com/illustration/tsp/voronoi.zip stippler.dll also contained in the above archive concorde.exe http://www.math.uwaterloo.ca/tsp/concorde/downloads/codes/cygwin/concorde.exe.gz this program needs the cygwin dll (a very nice one) (I've used 7zip to open this archive) cygwin1.dll https://cygwin.com/snapshots/ get one x86 cygwin1-xxxxxxxx.dll.xz (only dll) svg_extract.exe http://www.drububu.com/illustration/tsp/svg_extract.zip tsp2svg.exe http://www.drububu.com/illustration/tsp/tsp2svg.zip here the script:
    ; TSP Art generator #include <FileConstants.au3> #include <WinAPISys.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> #include <GDIPlus.au3> If Not _CheckDependencies() Then Exit ; can't run without dependencies. Global $bDropped, $sFile, $bDropAllowed = True ; create a blank file, or empty it if it's already created Global $hTail, $sLogFile = FileGetShortName(@ScriptDir & "\LogFile.txt") _GDIPlus_Startup() ; just for image format conversion to PNG (if needed) $Form1 = GUICreate("TSP art generator", 500, 650, -1, -1, -1, $WS_EX_ACCEPTFILES) ; --- options $Combo1 = GUICtrlCreateCombo("", 350, 505, 60, 25) GUICtrlCreateLabel("Sampling points", 415, 510, 80, 25) GUICtrlSetData($Combo1, "1000|2000|4000|6000|8000|10000|20000|40000|60000", "4000") ; some sampling rate $Checkbox1 = GUICtrlCreateCheckbox("Variable thickness line", 350, 535, 145, 25) $Checkbox2 = GUICtrlCreateCheckbox("Color (voronoi only)", 350, 565, 145, 25) ; --- Log viewer Global $hLog = GUICtrlCreateEdit("", 5, 500, 340, 145, BitOR($WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_MULTILINE, $ES_READONLY)) ; log viewer GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetFont(-1, 9, -1, -1, "Courier New") ; following is a transparent control over the browser control ; purpose is to avoid that the drop event is captured by the browser control $hGlass = GUICtrlCreateLabel("", 0, 0, 500, 650) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ; This is like a glass over the following underlying browser Control GUICtrlSetCursor(-1, 2) ; Cursor is an arrow (instead of the default I-beam) ; --- Embed a browser control Global $oIE = ObjCreate("Shell.Explorer.2") $hIE = GUICtrlCreateObj($oIE, 5, 5, 490, 490) $oIE.navigate("about:blank") AutoItSetOption("GUIOnEventMode", 1) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") GUISetState(@SW_SHOW, $Form1) _LogPrint(@CRLF & _ "Hello," & @CRLF & _ "Drag and dropping images here above," & @CRLF & _ "will be converted into a TSP Art." & @CRLF & _ "have fun...") ; --- Main loop While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE _Exit() Case $bDropped = True $bDropped = False $bDropAllowed = False ; Drop not allowed while generating _Generate_PST_Art() $bDropAllowed = True EndSelect WEnd ; --- Call externa programs the right sequence Func _Generate_PST_Art() _EmptyLog() ; empty the temporary log file _checkFileFormat($sFile) ; if dropped image isn't a PNG convert it to PNG _ShowInBrowser($sFile) ; show dropped image in the browser control ; step 1) Transform PNG image into a voronoi svg image ; ============================================================================ If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then ; variable thickness line? $sOptions = "" Else $sOptions = " -f " ; fixed radus EndIf If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then ; color points for voronoi? $sOptions = " -c " & $sOptions EndIf ; _call_External_Program(".\voronoi.exe " & $sOptions & "-s " & GUICtrlRead($Combo1) & " -n -I " & $sFile & " -O out.svg", True) _call_External_Program(FileGetShortName(@ScriptDir & '\voronoi.exe') & $sOptions & ' -s ' & GUICtrlRead($Combo1) & ' -n -I ' & $sFile & ' -O out.svg', True) _ShowInBrowser(FileGetShortName(@ScriptDir & "\out.svg")) ; show generated voronoi image in the browser control ; ; step 2) Extract points from the voronoi svg image and save to positions.tsp file ; for later input by the concorde TSP solver ; ============================================================================ _call_External_Program(FileGetShortName(@ScriptDir & '\svg_extract.exe') & " out.svg") _LogPrint("... going to next step ...") ; ; step 3) Resolve the Traveling Salesman Problem using the very good ; concorde.exe program (it needs the presence of the cygwin1.dll to work) ; ============================================================================ _call_External_Program(FileGetShortName(@ScriptDir & "\concorde.exe") & " -V -o tour.cyc positions.tsp", True) _LogPrint("... going to next step ...") ; ; step 3a) some adjustments to the tour.cyc file generated by concorde.exe ; ============================================================================ $hfile = FileOpen(FileGetShortName(@ScriptDir & '\tour.cyc')) Local $sContent = FileRead($hfile) FileClose($hfile) FileDelete(FileGetShortName(@ScriptDir & '\tour.cyc')) $sContent = StringReplace($sContent, Chr(0x20), Chr(0x0A)) _LogPrint("Replaced 0x20 with 0x0A " & @extended & " times.") $sContent = StringReplace($sContent, Chr(0x0A) & Chr(0x0A), Chr(0x0A)) _LogPrint("Replaced 0x0A 0x0A with 0x0A " & @extended & " times." & @CRLF) Local $x = StringInStr($sContent, Chr(0x0A)) ; first 0A $sContent = StringMid($sContent, $x + 1) ; remove first data (it's the number of points, not a point) $hfile = FileOpen(FileGetShortName(@ScriptDir & '\tour.cyc'), $FO_OVERWRITE + $FO_BINARY) FileWrite($hfile, $sContent) ; save adjusted data FileFlush($hfile) FileClose($hfile) ; ; step 4) "merge" data from out.svg and tour.cyc into the final tsp_art.svg file ; ============================================================================ If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then $sOptions = " +w" ; variable thickness line Else $sOptions = "" ; fixed thickness line EndIf $sOptions = FileGetShortName(@ScriptDir & "\tsp2svg.exe") & " out.svg tour.cyc" & $sOptions _call_External_Program($sOptions) _ShowInBrowser(FileGetShortName(@ScriptDir & "\tsp_art.svg")) _LogPrint(@CRLF & _ "+-----------------------------------+" & @CRLF & _ "| End of conversion --> tsp_art.svg |" & @CRLF & _ "+-----------------------------------+" & @CRLF) EndFunc ;==>_Generate_PST_Art ; === Functions Func _call_External_Program($sCommand, $bVerbose = False) Local $sLine If $bVerbose = True Then $sCommand = @ComSpec & " /c " & $sCommand & ">>" & $sLogFile & " 2>>&1" EndIf Local $hPid = Run($sCommand, ".", @SW_HIDE) If Not $hPid Then _LogPrint("Error on run external program" & @CRLF) Return SetError(1) EndIf Do If $bVerbose Then $sLine = FileReadLine($hTail) If Not @error Then _LogPrint($sLine) EndIf EndIf Until Not ProcessExists($hPid) If $bVerbose Then $sLine = "..." ; "Task execution terminated ...." Do _LogPrint($sLine) $sLine = FileReadLine($hTail) Until @error EndIf EndFunc ;==>_call_External_Program Func _LogPrint($sLine) If StringLen(GUICtrlRead($hLog)) > 25000 Then ; Max Len of a CtrlBox is 30000 char _GUICtrlEdit_SetText($hLog, StringRight(GUICtrlRead($hLog), 20000)) ; short the content of CtrlBox to 20000 char EndIf _GUICtrlEdit_AppendText($hLog, $sLine & @CRLF) EndFunc ;==>_LogPrint Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) If $bDropAllowed Then Local $sExt = ".bmp|.png|.jpg|.gif" ; img drop filtering thanks to @UEZ Local $aFileList = _WinAPI_DragQueryFileEx($wParam) If Not @error Then For $i = 1 To $aFileList[0] If StringInStr($sExt, StringRegExpReplace($aFileList[$i], ".*(\.+)", "$1")) Then $bDropped = True $sFile = FileGetShortName($aFileList[$i]) ExitLoop EndIf Next Else _LogPrint("Error on drop" & @CRLF) EndIf _WinAPI_DragFinish($wParam) _LogPrint("Droped: " & $sFile & @CRLF) Return 0 EndIf EndFunc ;==>WM_DROPFILES Func _ShowInBrowser($sImg) ; setup Javascript engine with also embeded the "entity" library If StringRight($sImg, 3) = "svg" Then Else EndIf ; *** create a minimal 'html' page listing for the browser control Local $sHTML = "<HTML><HEAD>" & @CRLF & _ "<meta http-equiv=""X-UA-Compatible"" content=""IE=edge"" />" & @CRLF & _ "</HEAD>" & @CRLF & _ "<body>" & @CRLF & _ '<img src="' & $sImg & '" style="width:100%; height:100%;" />' & @CRLF & _ "</body>" & @CRLF & _ "</HTML>" & @CRLF ; html closing tags ; *** end of html page listing ; _LogPrint(">_" & @CRLF) $oIE.navigate('about:blank') While Not String($oIE.readyState) = 'complete' ; wait for about:blank Sleep(100) WEnd $oIE.document.Write($sHTML) ; inject lising directly to the HTML document: $oIE.document.close() ; close the write stream Sleep(1000) $oIE.document.execCommand("Refresh") EndFunc ;==>_ShowInBrowser Func _checkFileFormat($sFile) Local $hImage = _GDIPlus_ImageLoadFromFile($sFile) Local $aFormat = _GDIPlus_ImageGetRawFormat($hImage) If $aFormat[1] <> "PNG" Then _ConvertToPNG($hImage) _GDIPlus_ImageDispose($hImage) EndFunc ;==>_checkFileFormat Func _ConvertToPNG(ByRef $hImage) Local $CLSID = _GDIPlus_EncodersGetCLSID('PNG') $sFile = FileGetShortName(@ScriptDir & "\Input.png") _GDIPlus_ImageSaveToFileEx($hImage, $sFile, $CLSID) EndFunc ;==>_ConvertToPNG Func _EmptyLog() FileClose($hTail) $hTail = FileOpen($sLogFile, $FO_OVERWRITE) FileWrite($hTail, "Start log: " & @YEAR & '/' & @MON & '/' & @MDAY & ' ' & @HOUR & ':' & @MIN & ':' & @SEC & @CRLF) FileFlush($hTail) FileClose($hTail) $hTail = FileOpen($sLogFile) ; read only EndFunc ;==>_EmptyLog Func _CheckDependencies() Local $iDependencie = 0 $iDependencie += FileExists(@ScriptDir & "\voronoi.exe") ; http://www.drububu.com/illustration/tsp/voronoi.zip $iDependencie += FileExists(@ScriptDir & "\stippler.dll") ; " also contained in the above archive $iDependencie += FileExists(@ScriptDir & "\concorde.exe") ; http://www.math.uwaterloo.ca/tsp/concorde/downloads/codes/cygwin/concorde.exe.gz $iDependencie += FileExists(@ScriptDir & "\cygwin1.dll") ; get one from here https://cygwin.com/snapshots/ get cygwin1-xxxxxxxxx.dll.xz $iDependencie += FileExists(@ScriptDir & "\svg_extract.exe") ; http://www.drububu.com/illustration/tsp/svg_extract.zip $iDependencie += FileExists(@ScriptDir & "\tsp2svg.exe") ; http://www.drububu.com/illustration/tsp/tsp2svg.zip Return $iDependencie = 6 EndFunc ;==>_CheckDependencies Func _Exit() _GDIPlus_Shutdown() FileClose($hTail) AutoItSetOption("GUIOnEventMode", 0) GUIRegisterMsg($WM_DROPFILES, "") Exit EndFunc ;==>_Exit  
  19. Like
    wakillon reacted to Gianni in Ascii Art Kaleidoscope   
    A simple endless kaleidoscope made  on a RichEdit control (hit esc to exit)
    Idea is from this link: http://www.calormen.com/jsbasic/ select the "Rod's Color Pattern" demo and run it on the Apple 2 emulator on that web page to see the original Apple II version.
    ; Idea from this link: http://www.calormen.com/jsbasic/ ; get the "Rod's Color Pattern" from the "Select a sample..." combo and run it ; #include <GuiRichEdit.au3> #include <GUIConstants.au3> HotKeySet("{ESC}", "_TheEnd") ; Global $iHwidth = 40, $iVheight = 40; width and height of screen Global $sBuffer = _StringReplay(_StringReplay(" ", $iHwidth + 1) & @CRLF, $iVheight) ;to fill the RichEdit Global $sChar = " " Global Const $aApplesoft_color[16] = [ _ ; LoRes colors in Applesoft basic 0x000000, _ ; 0x0 = 00 = Black 0XFF00FF, _ ; 0x1 = 01 = Magenta 0X0000A0, _ ; 0x2 = 02 = Dark Blue 0X800080, _ ; 0x3 = 03 = Purple 0X006400, _ ; 0x4 = 04 = Dark Green 0X808080, _ ; 0x5 = 05 = Grey 0X0000CD, _ ; 0x6 = 06 = Medium Blue 0XADD8E6, _ ; 0x7 = 07 = Light Blue 0XA52A2A, _ ; 0x8 = 08 = Brown 0XFFA500, _ ; 0x9 = 09 = Orange 0XD3D3D3, _ ; 0xA = 10 = Light Grey 0XFFC0CB, _ ; 0xB = 11 = Pink 0X008000, _ ; 0xC = 12 = Green 0XFFFF00, _ ; 0xD = 13 = Yellow 0X00FFFF, _ ; 0xE = 14 = Aqua 0xFFFFFF]; ; 0xF = 15 = White Global $MyGui = GUICreate("", 335, 630, -1, -1, $WS_POPUPWINDOW, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE, $WS_EX_COMPOSITED, $WS_EX_LAYERED)) $hGlass = GUICtrlCreateLabel("", 0, 0, 335, 630, -1, $GUI_WS_EX_PARENTDRAG) ; Protect the RichEdit and allows to drag the GUI around GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ; This is like a glass over the underlying RichEdit GUICtrlSetCursor(-1, 2) ; Cursor is an arrow (instead of the default I-beam) ; ; This RichEdit is used to simulate the LoRes Graphic of tha Apple 2 (40x40 pixels) Global $hGR = _GUICtrlRichEdit_Create($MyGui, $sBuffer, 0, 0, 335, 630, BitOR($ES_READONLY, $ES_MULTILINE)) _GUICtrlRichEdit_SetSel($hGR, 0, -1) _GUICtrlRichEdit_SetFont($hGR, 10, "Courier new") _GUICtrlRichEdit_SetBkColor($hGR, 0xffffff) GUISetState() ; Main loop ; --------- While 1 For $W = 3 To 50 For $x = 19 To 1 Step -1 For $y = 19 To 0 Step -1 $xy = $x + $y $iColor = Mod(Int($y * 3 / ($x + 3) + $x * $W / 12), 16) $sChar = ChrW(32 + $iColor) ; comment this if you don't want chars (only color) If $iColor > 15 Then $iColor = 15 Print($sChar, $x, $xy, $iColor) Print($sChar, $xy, $x, $iColor) Print($sChar, 40 - $x, 40 - $xy, $iColor) Print($sChar, 40 - $xy, 40 - $x, $iColor) Print($sChar, $xy, 40 - $x, $iColor) Print($sChar, 40 - $x, $xy, $iColor) Print($sChar, $x, 40 - $xy, $iColor) Print($sChar, 40 - $xy, $x, $iColor) Next Next Next WEnd ; Print a char to Htab (Horiz. pos), Vtab (Vert pos) on the RichEdit ; ------------------------------------------------------------------ Func Print($sChar = "", $iHtab = 1, $iVtab = 1, $iColor = 0xffffff) _GUICtrlRichEdit_SetSel($hGR, GetAbsPos($iHtab, $iVtab), GetAbsPos($iHtab, $iVtab) + 1, True) _GUICtrlRichEdit_SetCharBkColor($hGR, $aApplesoft_color[$iColor]) _GUICtrlRichEdit_ReplaceText($hGR, $sChar, False) EndFunc ;==>Print ; From Htab Vtab (1 based) to Absolute position within the RichEdit ; ----------------------------------------------------------------- Func GetAbsPos($iHtab = 1, $iVtab = 1, $iScreenWidth = $iHwidth) Return ($iVtab - 1) * ($iScreenWidth + 2) + $iHtab EndFunc ;==>GetAbsPos ; returns one or more chars replicated n times ; Example: ConsoleWrite(_StringReplay('*', 5) & @CRLF) Func _StringReplay($sChars = "", $iRepeats = 0) $sChars = String($sChars) $iRepeats = Int(Abs(Number($iRepeats))) Return StringReplace(StringFormat('%' & $iRepeats & 's', ""), " ", $sChars) EndFunc ;==>_StringReplay Func _TheEnd() If WinActive("[ACTIVE]") = $MyGui Then _GUICtrlRichEdit_Destroy($hGR) Exit EndIf EndFunc ;==>_TheEnd  
  20. Like
    wakillon reacted to haijie1223 in Rotate animation   
    #NoTrayIcon #RequireAdmin #My QQ No: 29535065 #QQ group: 477266297 #include <GDIPlus.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) Global $iSleepTime = 80 Global $hGUI = GUICreate("GDI+旋转动画", 400, 280) Global $Pic_Animation = GUICtrlCreatePic('', 5, 5, 256, 256) Global $Btn_Type1 = GUICtrlCreateButton('旋转方式一', 275, 35, 100, 30) Global $Btn_Type2 = GUICtrlCreateButton('旋转方式二', 275, 85, 100, 30) Global $Btn_Type3 = GUICtrlCreateButton('旋转方式三', 275, 135, 100, 30) Global $Slider_Time = GUICtrlCreateSlider(275, 185, 100, 45) GUICtrlSetLimit($Slider_Time, 500, 50) GUISetState() GUISetIcon('shell32.dll',322,$hGUI) GUISetOnEvent(-3, '_GuiEvent') GUICtrlSetOnEvent($Btn_Type1, '_GuiEvent') GUICtrlSetOnEvent($Btn_Type2, '_GuiEvent') GUICtrlSetOnEvent($Btn_Type3, '_GuiEvent') GUICtrlSetOnEvent($Slider_Time, '_GuiEvent') _AnimationInit(ControlGetHandle($hGUI, '', $Pic_Animation), 1) _GDIPlus_Startup() ; While 1 Sleep($iSleepTime) _NextFlash() WEnd Func _GuiEvent() Switch @GUI_CtrlId Case -3 _DeleteCache() Exit Case $Btn_Type1 _ResetAniType(1, 2) Case $Btn_Type2 _ResetAniType(2, 0) Case $Btn_Type3 _ResetAniType(3, 0) Case $Slider_Time $iSleepTime=GUICtrlRead($Slider_Time) EndSwitch EndFunc ;==>_GuiEvent Func _AnimationInit($hHwd, $SpaceSec) Global $m_hWnd = $hHwd Global $m_nWidth, $m_nHeight Global $m_AnimationIndex = 0, $m_AnimationType = 0, $m_AnimationCount = 12 Global $m_ItemSize, $m_MarginAngle Global $m_hCacheDC, $m_hCacheBitmap, $m_hCacheOldBitmap Global $m_Rect = DllStructCreate($tagRECT) Global $m_ColorBack = _WinAPI_GetSysColor($COLOR_BTNFACE) Global $m_ColorBasic[2] = [0x808080, 0xC0C0C0] Global $m_ColorFore1 = [0x1FF4FB, 0x07F98C, 0x91A804, 0xCC9302, 0xAF5801, 0x9C426B, 0x9744A7, 0x9841E4, 0x241BEE, 0x2472F5, 0x2190F4, 0x12C2FF] Global $m_ColorFore2 = [0x34F5FF, 0x3CFDA3, 0xA5B833, 0xD8A733, 0xB67636, 0xAD6988, 0xAD68B9, 0xAC66E9, 0x514AEF, 0x4E8DF5, 0x4BA5FA, 0x3ECEFE] Global $m_AnimationArray[$m_AnimationCount] Local $i For $i = 0 To $m_AnimationCount - 1 $m_AnimationArray[$i] = _AnimationItem() DllStructSetData($m_AnimationArray[$i], 1, _RGB2ARGB($m_ColorBasic[0], 255)) DllStructSetData($m_AnimationArray[$i], 2, _RGB2ARGB($m_ColorBasic[1], 255)) Next _Resize() _ResetAniType($m_AnimationType, $SpaceSec) EndFunc ;==>_AnimationInit Func _RGB2ARGB($RGBColor, $Alpha) Return BitOR(Binary('0x' & Hex($RGBColor, 6)), BitShift($Alpha, -24)) EndFunc ;==>_RGB2ARGB Func _Resize() _DeleteCache() Local $rc = _WinAPI_GetClientRect($m_hWnd) $m_nWidth = DllStructGetData($rc, 3) - DllStructGetData($rc, 1) $m_nHeight = DllStructGetData($rc, 4) - DllStructGetData($rc, 2) If $m_nWidth > $m_nHeight Then DllStructSetData($m_Rect, 3, ($m_nHeight - 10)) Else DllStructSetData($m_Rect, 3, ($m_nWidth - 10)) EndIf ;~ DllStructSetData($m_Rect, 3, ($m_nWidth > $m_nHeight) ? ($m_nHeight - 10) : ($m_nWidth - 10)) DllStructSetData($m_Rect, 4, DllStructGetData($m_Rect, 3)) DllStructSetData($m_Rect, 1, ($m_nWidth - DllStructGetData($m_Rect, 3)) / 2) DllStructSetData($m_Rect, 2, ($m_nHeight - DllStructGetData($m_Rect, 4)) / 2) $m_ItemSize = 20 EndFunc ;==>_Resize Func _ResetAniType($AniType, $SpaceSec = 0) Local $i $m_AnimationIndex = 0 Switch $AniType Case 0 $m_AnimationType = 0 Case 1 $m_AnimationType = 1 Case 2 $m_AnimationType = 2 For $i = 0 To $m_AnimationCount - 1 DllStructSetData($m_AnimationArray[$i], 1, _RGB2ARGB($m_ColorFore1[$i], 255)) DllStructSetData($m_AnimationArray[$i], 2, _RGB2ARGB($m_ColorFore2[$i], 255)) Next Case 3 $m_AnimationType = 3 For $i = 0 To $m_AnimationCount - 1 DllStructSetData($m_AnimationArray[$i], 1, _RGB2ARGB($m_ColorFore1[$i], 255)) DllStructSetData($m_AnimationArray[$i], 2, _RGB2ARGB($m_ColorFore2[$i], 255)) Next Case Else _ResetAniType(0) Return EndSwitch $m_MarginAngle = $SpaceSec If $m_MarginAngle > 10 Then $m_MarginAngle = 10 If $m_MarginAngle < 0 Then $m_MarginAngle = 0 EndFunc ;==>_ResetAniType Func _NextFlash() Local $i Switch $m_AnimationType Case 0 For $i = 0 To $m_AnimationIndex - 1 DllStructSetData($m_AnimationArray[$i], 1, _RGB2ARGB($m_ColorFore1[$i], 255)) DllStructSetData($m_AnimationArray[$i], 2, _RGB2ARGB($m_ColorFore2[$i], 255)) Next $m_AnimationIndex += 1 If ($m_AnimationIndex > $m_AnimationCount) Then $m_AnimationType = 1 $m_AnimationIndex = 0 EndIf Case 1 For $i = 0 To $m_AnimationIndex - 1 DllStructSetData($m_AnimationArray[$i], 1, _RGB2ARGB($m_ColorBasic[0], 255)) DllStructSetData($m_AnimationArray[$i], 2, _RGB2ARGB($m_ColorBasic[1], 255)) Next $m_AnimationIndex += 1 If ($m_AnimationIndex > $m_AnimationCount) Then $m_AnimationType = 0 $m_AnimationIndex = 0 EndIf Case 2 local $item=$m_AnimationArray[11] For $i = 0 To $m_AnimationCount - 2 $m_AnimationArray[$m_AnimationCount - $i - 1] = $m_AnimationArray[$m_AnimationCount - $i - 2] Next $m_AnimationArray[0] = $item Case 3 $m_AnimationIndex = $m_AnimationIndex + 1 If ($m_AnimationIndex > $m_AnimationCount) Then $m_AnimationIndex = 0 EndSwitch _Draw() EndFunc ;==>_NextFlash Func _Draw() Local $hDC = _WinAPI_GetDC($m_hWnd) If $m_hCacheDC = 0 Then $m_hCacheDC = _WinAPI_CreateCompatibleDC($hDC) $m_hCacheBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $m_nWidth, $m_nHeight) $m_hCacheOldBitmap = _WinAPI_SelectObject($m_hCacheDC, $m_hCacheBitmap) EndIf _FillSolidRect($m_hCacheDC, _CRect(0, 0, $m_nWidth, $m_nHeight), $m_ColorBack) _DrawPie($m_hCacheDC) _WinAPI_BitBlt($hDC, 0, 0, $m_nWidth, $m_nHeight, $m_hCacheDC, 0, 0, 0x00CC0020) _WinAPI_ReleaseDC($m_hWnd, $hDC) EndFunc ;==>_Draw Func _CRect($Left, $Top, $Right, $Bottom) Local $Rect = DllStructCreate($tagRECT) DllStructSetData($Rect, 1, $Left) DllStructSetData($Rect, 2, $Top) DllStructSetData($Rect, 3, $Right) DllStructSetData($Rect, 4, $Bottom) Return $Rect EndFunc ;==>_CRect Func _FillSolidRect($hDC, $lpRect, $clr) _WinAPI_SetBkColor($hDC, $clr) _ExtTextOut($hDC, 0, 0, 2, $lpRect, Chr(0), 0, 0) EndFunc ;==>_FillSolidRect Func _DrawPie($hDC) Local $i Local $nStartAngle Local $nSweepAngle Local $pGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC) _GDIPlus_GraphicsSetSmoothingMode($pGraphics, 4) Local $pBrush = _GDIPlus_BrushCreateSolid(_RGB2ARGB(0, 255)) Local $rcOut = DllStructCreate($tagRECT) DllStructSetData($rcOut, 1, DllStructGetData($m_Rect, 1)) DllStructSetData($rcOut, 2, DllStructGetData($m_Rect, 2)) DllStructSetData($rcOut, 3, DllStructGetData($m_Rect, 3)) DllStructSetData($rcOut, 4, DllStructGetData($m_Rect, 4)) Local $rcIn = DllStructCreate($tagRECT) DllStructSetData($rcIn, 1, DllStructGetData($rcOut, 1)) DllStructSetData($rcIn, 2, DllStructGetData($rcOut, 2)) DllStructSetData($rcIn, 3, DllStructGetData($rcOut, 3)) DllStructSetData($rcIn, 4, DllStructGetData($rcOut, 4)) _InflateRectF($rcIn, -1 * $m_ItemSize) $nSweepAngle = 360 / $m_AnimationCount $nStartAngle = -90 For $i = 0 To $m_AnimationCount - 1 _GDIPlus_BrushSetSolidColor($pBrush, DllStructGetData($m_AnimationArray[$i], 1)) _GDIPlus_GraphicsFillPie($pGraphics, DllStructGetData($rcOut, 1), DllStructGetData($rcOut, 2), DllStructGetData($rcOut, 3), DllStructGetData($rcOut, 4), _ $nStartAngle, $nSweepAngle - $m_MarginAngle, $pBrush) $nStartAngle += $nSweepAngle Next $nSweepAngle = 360 / $m_AnimationCount $nStartAngle = -90 For $i = 0 To $m_AnimationCount - 1 _GDIPlus_BrushSetSolidColor($pBrush, DllStructGetData($m_AnimationArray[$i], 2)) _GDIPlus_GraphicsFillPie($pGraphics, DllStructGetData($rcIn, 1), DllStructGetData($rcIn, 2), DllStructGetData($rcIn, 3), DllStructGetData($rcIn, 4), _ $nStartAngle, $nSweepAngle - $m_MarginAngle, $pBrush) $nStartAngle += $nSweepAngle Next If ($m_AnimationType = 3) Then If $m_AnimationIndex > 0 Then $nStartAngle = -90 $nStartAngle = $nStartAngle + $m_AnimationIndex * $nSweepAngle _GDIPlus_BrushSetSolidColor($pBrush, _RGB2ARGB(0xFFFFFF, 150)) _GDIPlus_GraphicsFillPie($pGraphics, DllStructGetData($rcOut, 1), DllStructGetData($rcOut, 2), DllStructGetData($rcOut, 3), DllStructGetData($rcOut, 4), _ $nStartAngle, $nSweepAngle - $m_MarginAngle, $pBrush) EndIf EndIf _InflateRectF($rcIn, -1 * $m_ItemSize) _GDIPlus_BrushSetSolidColor($pBrush, _RGB2ARGB($m_ColorBack, 255)) _GDIPlus_GraphicsFillPie($pGraphics, DllStructGetData($rcIn, 1), DllStructGetData($rcIn, 2), DllStructGetData($rcIn, 3), DllStructGetData($rcIn, 4), 0, 360, $pBrush) _GDIPlus_BrushDispose($pBrush) _GDIPlus_GraphicsDispose($pGraphics) EndFunc ;==>_DrawPie Func _InflateRectF($rc, $dx, $dy = 0) If $dy = 0 Then $dy = $dx DllStructSetData($rc, 1, DllStructGetData($rc, 1) - $dx) DllStructSetData($rc, 2, DllStructGetData($rc, 2) - $dy) DllStructSetData($rc, 3, DllStructGetData($rc, 3) + $dx * 2) DllStructSetData($rc, 4, DllStructGetData($rc, 4) + $dy * 2) EndFunc ;==>_InflateRectF Func _DeleteCache() If $m_hCacheDC <> 0 Then _WinAPI_SelectObject($m_hCacheDC, $m_hCacheOldBitmap) _WinAPI_DeleteObject($m_hCacheBitmap) _WinAPI_DeleteDC($m_hCacheDC) _GDIPlus_Shutdown() $m_hCacheDC = 0 $m_hCacheBitmap = 0 $m_hCacheOldBitmap = 0 EndIf EndFunc ;==>_DeleteCache Func _ExtTextOut($hDC, $x, $y, $wOptions, $lpRect, $lpString, $nCount, $lpDx) If Not IsPtr($lpRect) Then $lpRect=DllStructGetPtr($lpRect) Local $Ret = DllCall('GDI32.dll', 'BOOL', 'ExtTextOutW', 'HANDLE', $hDC, 'INT', $x, 'INT', $y, 'UINT', $wOptions, 'PTR', $lpRect, 'WSTR', $lpString, 'UINT', $nCount, 'INT', $lpDx) If @error Then Return SetError(@error, 0, 0) Return $Ret[0] EndFunc ;==>_ExtTextOut Func _AnimationItem() Return DllStructCreate('INT;INT;') EndFunc ;==>_AnimationItem  
     
  21. Like
    wakillon reacted to seangriffin in SFML UDF - Simple and Fast Multimedia Library for AutoIT   
    Here's the beginnings of SFML (the Simple and Fast Multimedia Library) for AutoIT. 
    This library provides a wealth of features for developing games and multimedia applications.  You can read up more about SFML here -> http://www.sfml-dev.org.  It uses OpenGL as the renderer for 2D graphics such as sprites, so it's performance is quite good.
    Currently my interest is in 2D sprite engines, so my focus is on the sprite and window APIs.  This is the precursor to another separate UDF I'm working on and will release soon.  If there's any interest I'll flesh out more of this API for the community.
    CSFML is the "C" binding / API for SFML, and it's this API that I'm building this UDF against.
    REQUIREMENTS:
    AutoIt3 3.2 or higher LIST OF FUNCTIONS (so far):
    _CSFML_Startup _CSFML_Shutdown _CSFML_sfClock_create _CSFML_sfClock_getElapsedTime _CSFML_sfClock_restart _CSFML_sfVector2f_Constructor _CSFML_sfVector2f_Update _CSFML_sfVector2f_Move _CSFML_sfColor_Constructor _CSFML_sfColor_fromRGB _CSFML_sfSizeEvent_Constructor _CSFML_sfEvent_Constructor _CSFML_sfVideoMode_Constructor _CSFML_sfRenderWindow_create _CSFML_sfRenderWindow_setVerticalSyncEnabled _CSFML_sfRenderWindow_isOpen _CSFML_sfRenderWindow_pollEvent _CSFML_sfRenderWindow_clear _CSFML_sfRenderWindow_drawText _CSFML_sfRenderWindow_drawSprite _CSFML_sfRenderWindow_display _CSFML_sfRenderWindow_close _CSFML_sfTexture_createFromFile _CSFML_sfSprite_create _CSFML_sfSprite_destroy _CSFML_sfSprite_setTexture _CSFML_sfSprite_setPosition _CSFML_sfSprite_setRotation _CSFML_sfSprite_rotate _CSFML_sfSprite_setOrigin _CSFML_sfFont_createFromFile _CSFML_sfText_create _CSFML_sfText_setString _CSFML_sfText_setFont _CSFML_sfText_setCharacterSize _CSFML_sfText_setFillColor EXAMPLE:
    Currently I only have one example, which is the "Short example" described in the CSFML API documentation, plus some extra features.  Essentially a window (GUI) allowing you to move a sprite around with the keyboard (including rotation).
    DOWNLOAD:
    You can download this UDF, including the example and associated files, from the following GitHub page:
    https://github.com/seanhaydongriffin/CSFML-UDF
    Cheers,
    Sean.
  22. Like
    wakillon got a reaction from coffeeturtle in Animated Gif Analyzer   
    Animated Gif Analyzer
    Display internal infos from animated gifs
    Global and Local Palettes supported
    A value in red indicate that value is false or useless
    Flashing green text ( BK or TR)  indicate background color and transparent color
    Download available in download section

    I created this script because I needed, for an other project, to know in detail the internal characteristics of animated gif
    I had searched a similar soft on internet but I didnt found anything ...
     
  23. Like
    wakillon got a reaction from KaFu in Animated Gif Analyzer   
    Animated Gif Analyzer
    Display internal infos from animated gifs
    Global and Local Palettes supported
    A value in red indicate that value is false or useless
    Flashing green text ( BK or TR)  indicate background color and transparent color
    Download available in download section

    I created this script because I needed, for an other project, to know in detail the internal characteristics of animated gif
    I had searched a similar soft on internet but I didnt found anything ...
     
  24. Like
    wakillon got a reaction from nend in BinaryToAu3Kompressor v1.0.5.4 Update of 10 Oct 2014   
    BinaryToAu3Kompressor v1.0.5.4
     

     
    It's now possible to see the best compression ratio using LZMA, LZNT and Base64 compressions with differents combinations.
    Nothing too complicate, you drag'n drop a file on the picture and script Test all compression types and return the ratios.
    ( Test duration depends of file size, slowest compression is LZNT, but all decompressions are fast  )
    Free to you after, to choose the compression(s) you want...
    Yes, LZMA needs a dll ( embedded & compressed in script ) but brings a powerfull compression. 
    It opens scite with your file compressed to an au3 script with or without decompression function as you want.
    Hold Left Shift key when clicking button for just copy script to clipboard.
    Use the 3 compressions at a time works but doesn't give a good ratio, that's why i don't display it.
    Usefull for little files you want include in your scripts !
    No externals files needed, they are already in script.
    Previous downloads : 1103
    Source and Executable
    BinaryToAu3Kompressor will be added to the next version of >SciTEHopper
    Thanks to Ward for his >Base64.au3 and LZMA.au3, and trancexx for his >LZNT functions and his >Base64Decode function.
  25. Like
    wakillon got a reaction from Skysnake in Array delete blank element   
    Something like this ?


    #include <Array.au3> dim $arr1[4] $arr1[0]="" $arr1[1]="ABC" $arr1[2]="" $arr1[3]="xyz" $arr2 = _RemoveEmptyArrayElements ( $arr1 ) _ArrayDisplay ( $arr2 ) Func _RemoveEmptyArrayElements ( $_Array ) Local $_Item For $_Element In $_Array If $_Element= '' Then _ArrayDelete ( $_Array, $_Item ) Else $_Item+=1 EndIf Next Return ( $_Array ) EndFunc ;==> _RemoveEmptyArrayElements ( )
×
×
  • Create New...