Hi everyone. I'm used to programming in C/C++ and I've created some dialog based windows apps. Recently, I've got an assignment at work to learn C# + WPF and its capabilities showing video. My company works with cameras and my job is to create an app to show their feed. Learning C# was fairly easy as many people say C# is easier than C++ but I struggle with WPF. A LOT.

For starters, I have a 10 second HD video converted to bitmaps frame by frame and I'm supposed to show them. I should test the performance when adding more videos (multiple cameras) and then look for other possibilities. The company used DirectShow before but it no longer meets the requirements as I was told (mainly user experience, videos flicker when resizing window and so on). I'm used to programming in loops and procedures and this event handling thing is a whole new approach for me and so far I don't like it (although it's great for creating beautiful GUI). I hate it when I don't understand the flow of an app (and I don't at the moment).. I just tried creating a simple project with one image control and after clicking a button, an infinite loop is supposed to cycle through 10 images displaying them in 0.5sec intervals. Actually, I want it to start immediately but I don't know where to put the loop (I mentioned my problem with understanding WPF app flow) so that's why I tried a method for button click. But after I clicked the button, my application just froze without updating the image.

After doing some research, I think I should use BackgroundWorker but I still have a long way to go (I'm studying Programming WPF from Sells and Griffiths and it's at the end of the book). Could someone give me a simple example? Just an app displaying 10 BMPs in an infinite loop. And to my second question - what are the other options of showing video in WPF?

Whoah, that was one exhausting post. Thanks in advance to anyone who bears with me and for any help.

i worked on a project for my final year study where i needed to play a video as long as the application is running.I implemented all my windows using WPF except for the window where the video was to be played.I couldn't do that due to the fact that there is no timer in WPF,hence i added a normal windows form and was able to added the timer that enabled me to play the video.
To play the video without using the button,you could use the onInitialised event of the window that you intend to play the video.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.