Jump to content

DaProgrammer

Active Members
  • Posts

    144
  • Joined

  • Last visited

Everything posted by DaProgrammer

  1. u saw The Gui Version or u 1 of those who are afraid to test .exe files ?
  2. This is the Small Version, i won't release the code for the Gui Version for now, though i highly reccomend Downloading it just put the script in the same folder with some .jpg files and run. #region - Settings HotKeySet("{ESC}", "Terminate") Opt("WinTitleMatchMode", 3) ;Error Msg if no .jpg files were found If Not FileExists(@ScriptDir & "\*.jpg") Then MsgBox(16 + 262144, "Error", 'No JPG files were found') Exit EndIf #endregion ; #region - Load Images to Array ;Count the number of files Local $i = 0 $search = FileFindFirstFile(@ScriptDir & "\" & "*.jpg") While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $i = $i + 1 WEnd FileClose($search) ;Define an Array to contain the files and ratio Global $Files[$i + 1][2] $Files[0][0] = $i ;Load file names and image ratio to the Array $i = 0 $search = FileFindFirstFile(@ScriptDir & "\" & "*.jpg") While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $sizee = _GetJpegSize(@ScriptDir & "\" & $file) $i = $i + 1 $Files[$i][0] = "\" & $file $Files[$i][1] = $sizee[0] / $sizee[1] WEnd FileClose($search) #endregion ; #region - Main $Location = 1 ;Create GUI (gray Background) Global $FullGui = GUICreate(@ScriptName & " FullScreen_bg", @DesktopWidth, @DesktopHeight, 0, 0, 0x80000000, 0x00000008) GUISetState(@SW_SHOW, $FullGui) ;Show 1st Picture ShowPic($Location) ;Run the Picture change Func every 5000 ms. AdlibEnable("Nextt", 5000) ;Loop so Program wont shut down While 1 Sleep(1000) WEnd Func ShowPic($i) ;Fade out old Picture For $x = 254 To 1 Step - 5 WinSetTrans(@ScriptName & "FullScreen_img", "", $x) Next SplashOff() ;Create new Picture out of screen --> set trans to 0 --> move back to center $ImageSize = GetNewImageSize($Files[$i][1], @DesktopWidth, @DesktopHeight) SplashImageOn(@ScriptName & "FullScreen_img", @ScriptDir & "\" & $Files[$i][0], $ImageSize[0], $ImageSize[1], 5000, 5000, 1) WinSetTrans(@ScriptName & "FullScreen_img", "", 0) WinMove(@ScriptName & "FullScreen_img", "", (@DesktopWidth - $ImageSize[0]) / 2, (@DesktopHeight - $ImageSize[1]) / 2) ;Fade in new Picture For $x = 1 To 254 Step 5 WinSetTrans(@ScriptName & "FullScreen_img", "", $x) Next EndFunc ;==>ShowPic ;Func written by me :) , Returns a new Resolution based on area to work with ;and original resolution ratio --> in a 2dim Array Func GetNewImageSize($OrigRatio, $WorkAreaWidth, $WorkAreaHight) Local $NewImageSize[2] If $OrigRatio < $WorkAreaWidth / $WorkAreaHight Then $NewImageSize[0] = $WorkAreaHight * $OrigRatio $NewImageSize[1] = $WorkAreaHight Else $NewImageSize[0] = $WorkAreaWidth $NewImageSize[1] = $WorkAreaWidth / $OrigRatio EndIf Return $NewImageSize EndFunc ;==>GetNewImageSize ;Shows Next picture every 5000 ms (as specified in the AdlibEnable above) Func Nextt() If $Location < $Files[0][0] Then $Location = $Location + 1 Else $Location = 1 EndIf ShowPic($Location) EndFunc ;==>Nextt ;Gess what this does ??? Func Terminate() Exit EndFunc ;==>Terminate #endregion ; #region - JPEG ;=============================================================================== ; ; Description: Return JPEG size ; Parameter(s): File name ; Requirement(s): None ; Return Value(s): On Success - array with width and height ; On Failure empty string and sets @ERROR: ; 1 - File is not valid JPEG ; 2 - Info not found ; Author(s): YDY (Kot) <[email protected]> ; Version: 1.1.00 ; Date: 10.08.2004 ; Note(s): None ; ;=============================================================================== Func _GetJpegSize($file) Local $size[2] Local $fs, $pos = 3 $fs = FileGetSize($file) While $pos < $fs $data = _FileReadAtOffsetHEX($file, $pos, 4) If StringLeft($data, 2) = "FF" Then If StringInStr("C0 C2 CA C1 C3 C5 C6 C7 C9 CB CD CE CF", StringMid($data, 3, 2)) Then $seg = _FileReadAtOffsetHEX($file, $pos + 5, 4) $size[1] = Dec(StringLeft($seg, 4)) $size[0] = Dec(StringRight($seg, 4)) Return ($size) Else $pos = $pos + Dec(StringRight($data, 4)) + 2 EndIf Else ExitLoop EndIf WEnd SetError(2) Return ("") EndFunc ;==>_GetJpegSize ; Func _FileReadAtOffsetHEX($file, $offset, $bytes) Local $tfile = FileOpen($file, 0) Local $tstr = "" FileRead($tfile, $offset - 1) For $i = $offset To $offset + $bytes - 1 $tstr = $tstr & Hex(Asc(FileRead($tfile, 1)), 2) Next FileClose($tfile) Return ($tstr) EndFunc ;==>_FileReadAtOffsetHEX #endregion The Gui Version is in the .zip file attached, heres a Screenshot. SlideShow Maker (with GUI UI) Instructions Place all .jpg and .mp3 files in a folder named "Files" Features Plays .mp3 files Normal SlideShow + FullScreen SlideShow SlideShow delay slidebar Save Pictures to folder feature (very usefull for making gift CD with photos) Pretty buttons Hotkeys LEFT = Previous picture RIGHT = Next Picture SPACE = Play / Pause Slideshow ENTER = Go to fullscreen mode ESC = Exit Slide_Show_1.2.zip
  3. tnx m8 but i think ill go with the winmove and getpos its simpler
  4. How can i make the gui that the user wont be able to move it onscreen ? tnx for the help
  5. i used a Function that makes one step and the Run button starts that function as and adlib, and the terminate button stops that adlib. So heres the solution for those intersted.
  6. i know that exiting the function is the best way to check wheater to stop it or not. STROKE OF GENIUS : what if i enable adlib at 1000ms to change count, and button terminate will stop the adlib going to test it now. EDIT : it kinda works going to refine it and tell u how it came out
  7. Opt("GUIOnEventMode",1) GuiCreate("MyGUI", 392, 323,-1, -1) $Button_1 = GuiCtrlCreateButton("Run", 210, 190, 100, 60) GUICtrlSetOnEvent($Button_1,"Count") $Button_2 = GuiCtrlCreateButton("Terminate", 50, 200, 110, 60) GUICtrlSetOnEvent($Button_2,"Terminate") $Label_3 = GuiCtrlCreateLabel("Label3", 130, 50, 100, 50) GuiSetState() While 1 Sleep(1000) WEnd Func Count() For $i = 1 to 10 GUICtrlSetData($Label_3,$i) Sleep(1000) Next EndFunc Func Terminate() Exit EndFunc if u press run it will count to 10 and if u press Terminate when it reaches 3 (just an example) it will w8 till 10 and then terminate
  8. Any more ideas ? there must be a way to terminate a loop with a button. BTW : the loop doesnt have to be a "FOR" it can be any loop but i hardly think it will make a diffrence.
  9. can i use guigetmsg when in on event mode ? couse the prog does a lot of other stuff and im more comftable with on event EDIT : From the help File If the GUIOnEventMode option is set to 1 then the return from GUIGetMsg is always 0 and the @error is set to 1.
  10. Adlib wont work since i cant read the button being pressed untill the func ends, so correct me if im wrong but its the same as a regular button EDIT : is there a way to check if the button was pressed in the last couple of seconds ? or leave the button in pressed position untill its read and raised ?
  11. $Terminate = GUICtrlCreateButton("Exit",400,$WorkSpaceH+45,80,40) GUICtrlSetOnEvent($Terminate,"Terminate") Func Terminate() Exit EndFunc i tried to exit instead of stopping but it only exits when the loop is done
  12. i though there might be a better way ill try implementing it and hopefully it will work or some1 will suggest something better.
  13. Func Func() For $i = 1 to 10 Sleep(1000) Next EndFunc This Function is running and does stuff to the gui, my question is how can i stop it when the user presses the stop button ? i tried the on event button to run something like $Exit = 1 but $Exit wont update till the running func will end
  14. tnx m8 the first link is tha bomb just what i needed
  15. How Can i retrieve the resolution of a file ? i can't find any help in the Autoit commands so i though maybe some1 can help me with a DLLCall perhaps ?
  16. i did like 20 diffrent seaarches and found larrys topic on binary file sending but the _API functions are incomplete in the attached file there so i cant use it unless some1 gives me the Function, so dont tell me i didnt make an effort couse im looking for like 2 hours now !
  17. common ppl some1 must have got a filesend to work ? i saw the _APIFileRead & _APIFileWrite but can't find the Functions, can some1 gimme a link so ill try using API to read the files ?
  18. try using mouse down, some sleep like 10ms and then mouse up, maybe that will work better.
  19. Mode (read or write) to open the file in. Can be a combination of the following: 0 = Read mode 1 = Write mode (append to end of file) 2 = Write mode (erase previous contents) 4 = Read raw mode 8 = Create directory structure if it doesn't exist (See Remarks). 16 = Force binary(byte) reading and writing mode with FileRead and FileWrite 32 = Use Unicode UTF16 Little Endian mode when writing text with FileWrite and FileWriteLine (default is ANSI) 64 = Use Unicode UTF16 Big Endian mode when writing text with FileWrite and FileWriteLine (default is ANSI) 128 = Use Unicode UTF8 when writing text with FileWrite and FileWriteLine (default is ANSI) Both write modes will create the file if it does not already exist. The folder path must already exist (except using mode '8' - See Remarks). so 16 = Force binary(byte) reading and writing mode with FileRead and FileWrite + 1 = Write mode (append to end of file) = 17 that aint the problem
  20. I Try to send myself a screenshot but the resulting file is NULL, Can some1 plz look and tell me what im doing wrong ? I Run this to listen to incoming: $IPADDRESS = @IPAddress2 $PORT = 33891 TCPStartUp() $Socket = TCPListen($IPADDRESS, $PORT) If $Socket = -1 Then MsgBox(4112,"Error","$Socket = -1 " & @error) $Connected = -1 MsgBox(0,"","W8ing for connection on Socket: " & $Socket) Do $Connected = TCPAccept($Socket) Until $Connected <> -1 $Data = TCPRecv($Socket,1000000,1) $File = FileOpen(@ScriptDir & "\" & "1.jpg",17) FileWrite($File,$Data) FileClose($File) TCPCloseSocket($Socket) TCPShutDown() And then i run this to send the file : Opt("TrayIconDebug",1) #include <A3LScreenCap.au3> _ScreenCap_Capture(@ScriptDir & "\" & "0.jpg") TCPStartUp() $IPADDRESS = @IPAddress2 $PORT = 33891 $Data = "" $Socket = TCPConnect($IPADDRESS,$PORT) If @error Then MsgBox(4112,"Error","TCPConnect failed, error: " & @error) Else MsgBox(0,"","Sending File on Socket: " & $Socket) $File = FileOpen(@ScriptDir & "\" & "0.jpg", 16) $Data = FileRead($File) TCPSend($Socket,$Data) FileClose($File) EndIf TCPShutdown() But the resulting new file 1.jpg is 0 bytes, why is that ?
  21. i have the file but it still wont run and errors like: C:\Documents and Settings\KJ\Desktop\IT-Helper\IT-Helper.au3(91,12) : ERROR: syntax error (illegal character) FileWrite(" have nothing to do with the plugin, plz recheck and repost it again, maybe u changed the code or didnt copy it correctly.
  22. u have alot of stuff commented out and a lot of code mistakes like : C:\Documents and Settings\KJ\Desktop\IT-Helper\IT-Helper.au3(91,12) : ERROR: syntax error (illegal character) FileWrite(" C:\Documents and Settings\KJ\Desktop\IT-Helper\IT-Helper.au3(37,37) : ERROR: _ZipUnZip(): undefined function. _ZipUnZip("help.zip", @ScriptDir) and many more of the sort.
  23. can u elaborate couse i added there but it wont work
  24. i wrote a function and placed it in an au3 file in the include folder. now my question is how do i add it to scite so when i start writing it it will finish it for me ? like all the user defined functions that alredy exist in scite. so when i write "_d" it will have "_dateadd" "_datedayofweek" and my function will also be in the droplist.
×
×
  • Create New...