iceberg Posted July 14, 2006 Share Posted July 14, 2006 Hi, Just wondering if could I use the RANDOM function to to "store" the pic files and then use SplashImageOn function to display the pics randomly? Thanks. mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
Emperor Posted July 14, 2006 Share Posted July 14, 2006 If I understand you correctly you want to choose a random picture to show on your splash image? Well I suppose if your picture files were named with numbers only it could work. ;Randomly choose between 1.bmp, 2.bmp and 3.bmp SplashImageOn("", Random(1, 3, 1) & ".bmp") Link to comment Share on other sites More sharing options...
Briegel Posted July 14, 2006 Share Posted July 14, 2006 Hi, Just wondering if could I use the RANDOM function to to "store" the pic files and then use SplashImageOn function to display the pics randomly? Thanks.Try this (BETA) #Include <File.au3> #Include <Array.au3> $path = 'c:\images' $FileList =_FileListToArray ( $path ) For $i = 1 To $FileList[0] $image = $FileList[Random(1, $FileList[0])] SplashImageOn ( 'Title', $path & '\' & $image ) Sleep(3000) Next Link to comment Share on other sites More sharing options...
iceberg Posted July 14, 2006 Author Share Posted July 14, 2006 thanks for the replies. Emperor > after renaming my picture files to numbers, how i do write it in codes so that the script understands and works with SplashImage? Briegel > how to i use your code if I am planning to use FileInstall to copy the pictures? thanks again. mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
Emperor Posted July 14, 2006 Share Posted July 14, 2006 ;FileInstall() the pictures $Folder = @ScriptDir & "\Images\" FileInstall("1.bmp", $Folder & "1.bmp") FileInstall("2.bmp", $Folder & "2.bmp") FileInstall("3.bmp", $Folder & "3.bmp") ;Randomly show one SplashImageOn("Test", $Folder & Random(1, 3, 1) & ".bmp") BTW if you don't want to name your files with numbers you can easily incorporate Briegels example into this. Link to comment Share on other sites More sharing options...
Briegel Posted July 14, 2006 Share Posted July 14, 2006 (edited) Briegel > how to i use your code if I am planning to use FileInstall to copy the pictures? Sample: #Include <File.au3> #Include <Array.au3> $path = 'c:\images\' ; set to folder where images should install to DirCreate ( $path ) FileInstall ( 'c:\yourimages\pic1.xxx', $path, 1 ) FileInstall ( 'c:\yourimages\pic2.xxx', $path, 1 ) FileInstall ( 'c:\yourimages\pic3.xxx', $path, 1 ) FileInstall ( 'c:\yourimages\pic4.xxx', $path, 1 ) FileInstall ( 'c:\yourimages\pic5.xxx', $path, 1 ) ; so on $FileList =_FileListToArray ( $path ) For $i = 1 To $FileList[0] SplashImageOn ( 'Title', $path & '\' & $FileList[Random(1, $FileList[0])] ) Sleep(3000) ; set timer to change images Next DirRemove ( $path ) I wonder that I have to use 'DirCreate()' and 'DirRemove()'. Until now I thought I can use 'FileInstall()' without this. But I works. Briegel EDIT: language, grrrr Edited July 14, 2006 by Briegel Link to comment Share on other sites More sharing options...
iceberg Posted July 14, 2006 Author Share Posted July 14, 2006 thanks alot for the excellent scripting Emperor & Briegel. both works great. mouse not found....scroll any mouse to continue. 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