I want to create an image slideshow using WPF and C#, but I don`t know how to do this. I want to do it automatically (change picture after time) and also by buttons that user can click on …
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One way is to have all your images in a folder and then use a timer to control the code that chooses one of these images. If you you want it to be random you could do something like this:
If you want sequential then just generate the list once, keep a note of the current position and then just increment it – taking care to roll back to 0 when you hit the end of the array.
In the main UI thread, handle the event and update an
<Image>to display the image.The next and previous buttons can just select the next and previous images in the folder.