linvin001 Posted December 12, 2014 Posted December 12, 2014 im trying to sort the image array into slideshow with 4 images display everytime in a loop. when i choose the multiple images(around 12), the first element in the array is the path, so the slideshow would have a black one. how can I separate the path and assign the image into new array. here is what i did so far, but not working #include <Array.au3> Global $aFiles = FileOpenDialog("select images", @WindowsDir & "\", "Images (*.jpg;*.bmp;*.png;*.gif)", 1 + 4) Local $arr = StringSplit($aFiles, "|") _ArrayDisplay($arr) for $i=1 to UBound($arr)-1 $arr[1]=$imagedir $narr[$i]=$arr[$i] next _ArrayDisplay($arr) looks like col 0 row0 13 row1 c:userspics row2 1.jpg row3 2.jpg ... etc Thanks
Jfish Posted December 12, 2014 Posted December 12, 2014 (edited) I am not 100% sure what you are trying to do but it seems like when you select files from the file open dialog they are all images and you want the first element to be the file path. Everything before the for loop does that. It also sounds like the the path is the problem for you because it is not an image so it shows a black background. If that is the problem you don't need to delete anything ... just start your slideshow at $arr[2]. for $i=2 to UBound($arr)-1 Does that make sense? Otherwise, if you wanted to delete it you could do this: #include <Array.au3> Global $aFiles = FileOpenDialog("select images", @WindowsDir & "\", "Images (*.jpg;*.bmp;*.png;*.gif)", 1 + 4) Local $arr = StringSplit($aFiles, "|") _ArrayDisplay($arr) _ArrayDelete($arr,1); deletes index 1 element from array with directory _ArrayDisplay($arr) Edited December 12, 2014 by Jfish Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt
linvin001 Posted December 13, 2014 Author Posted December 13, 2014 thanks. The path is the problem, I'm trying to switch between slideshow and browsers, so I need to make the image into infinite loop with only 5 or 6 image every time.
Jfish Posted December 13, 2014 Posted December 13, 2014 Like I said, you can zap the path from the array or just run the loop from the second element to the last element of the array (ignoring the path by skipping over it). Either should work. Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt
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