DaProgrammer Posted August 30, 2007 Posted August 30, 2007 (edited) 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.expandcollapse popup#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) <mpc@nm.ru> ; 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)InstructionsPlace all .jpg and .mp3 files in a folder named "Files"FeaturesPlays .mp3 filesNormal SlideShow + FullScreen SlideShowSlideShow delay slidebarSave Pictures to folder feature (very usefull for making gift CD with photos)Pretty buttons HotkeysLEFT = Previous pictureRIGHT = Next PictureSPACE = Play / Pause SlideshowENTER = Go to fullscreen modeESC = ExitSlide_Show_1.2.zip Edited August 30, 2007 by DaProgrammer
DaProgrammer Posted August 30, 2007 Author Posted August 30, 2007 Nice! Waiting for the gui code... u saw The Gui Version or u 1 of those who are afraid to test .exe files ?
JohnBailey Posted August 30, 2007 Posted August 30, 2007 nice udf and nice looking guiu saw The Gui Version or u 1 of those who are afraid to test .exe files ?I think he meant he looks forward to seeing the code since you mentioned that you highly recommend showing the code. A decision is a powerful thing
DaProgrammer Posted August 30, 2007 Author Posted August 30, 2007 nice udf and nice looking guiI think he meant he looks forward to seeing the code since you mentioned that you highly recommend showing the code. i said i highly reccomend using it since its ub33r nice
Toady Posted August 30, 2007 Posted August 30, 2007 wow this is pretty cool! I love the gui www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding
DaProgrammer Posted August 30, 2007 Author Posted August 30, 2007 wow this is pretty cool! I love the gui tmx man, i was amazed myself at how pretty it came out Comments on bugs and gliches will be welcome.
WeMartiansAreFriendly Posted August 30, 2007 Posted August 30, 2007 Nice job! about the gui? why didnt you supply the source to that too?? Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
gseller Posted August 30, 2007 Posted August 30, 2007 Don't care much for the exe files.. I like being able to see what is going to happen when I run a file.. I did run yours tho and it is a very nice gui, just would rather see the code.
DaProgrammer Posted August 30, 2007 Author Posted August 30, 2007 (edited) Nice job! about the gui? why didnt you supply the source to that too?? Its very messy, split into many files, many icon files, modefied XSkin, and a shitload of a mess that i made the .exe works and i aint got the powa to clean the soure !unless some1 reports a bug or something to fix, by this time tommorow i'll probably be off to my next project.just need to figure out what it will be, LOLp.s. some ideas will be nice Edited August 30, 2007 by DaProgrammer
DaProgrammer Posted August 31, 2007 Author Posted August 31, 2007 39 downloads and so little replys ? common ppl ill fix that bug thats bugging u
DaProgrammer Posted September 1, 2007 Author Posted September 1, 2007 Cannot run the exe, gives error on line 1.give the entire error plz couse compiled script always says line1 but it isnt really line1
Generator Posted September 1, 2007 Posted September 1, 2007 give the entire error plz couse compiled script always says line1 but it isnt really line1 It only says line 1
DaProgrammer Posted September 1, 2007 Author Posted September 1, 2007 dont have time ATM but will upload newer version in a couple of huores maybe it will fix ur error.
WeMartiansAreFriendly Posted September 1, 2007 Posted September 1, 2007 Its very messy, split into many files, many icon files, modefied XSkin, and a shitload of a mess that i made the .exe works and i aint got the powa to clean the soure !unless some1 reports a bug or something to fix, by this time tommorow i'll probably be off to my next project.just need to figure out what it will be, LOLp.s. some ideas will be niceMaybe if you posted the source, its more than likely someone will followup with clean version of your code.Just a suggestion. Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
JustinReno Posted September 1, 2007 Posted September 1, 2007 I get an error, maybe what was related to Generators. I put the GUI version of the program in a folder with 104 of .JPG Files. It said it didnt find any... Is the file search in your program case sensitive(.jpg it will find, .JPG it wont)? It doesnt do that with the source..
Zedna Posted September 1, 2007 Posted September 1, 2007 On WIN98 it don't work. will not start up Resources UDF ResourcesEx UDF AutoIt Forum Search
DaProgrammer Posted September 1, 2007 Author Posted September 1, 2007 I get an error, maybe what was related to Generators.I put the GUI version of the program in a folder with 104 of .JPG Files.It said it didnt find any... Is the file search in your program case sensitive(.jpg it will find, .JPG it wont)?It doesnt do that with the source..if u read what it says 'No JPG files were found in the Folder: "Files"' than ull see u have to put the jpg in a folder named "Files"
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