C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
DirectX Video in a picturebox Posted by polakos on 11 Sept 2009 at 6:09 AM
I am trying to show a slideshow that has the ability to play movies. The slideshow works fine (runs off a timer). I added a picturebox and made a directx video its child. When I run the slideshow, the pictures show up fine until the movie comes. The movie plays, but the last frame of the movie covers the picturebox and allows no more pictures to show. Below is a code snip. I was wondering if anyone knew why the picturebox does not resume normal operation after the video object is disposed?

//In timer tick function
switch (ext)
{
case "jpg":
pictureBox.Visible = true;
pictureBox.SizeMode = PictureBoxSizeMode.Zoom;
pictureBox.ImageLocation = currentPacket.thePayload.file;
pictureBox.Invalidate();

//Setup timer for next slide request
myTimer.Stop();
myTimer.Interval = (double)(pkt.thePayload.duration) * 1000;
myTimer.Start();
break;

case "mpg":
pictureBox.Visible = true;
videoDisplay = new Video(currentPacket.thePayload.file, false);
videoDisplay.Size = pictureBox.Size;
videoDisplay.Owner = pictureBox;
videoDisplay.Ending += new EventHandler(videoDisplay_Ending);
videoDisplay.Play();
myTimer.Stop();
break;
}

//This function starts the next slide when the video stops playing
void videoDisplay_Ending(object sender, EventArgs e)
{
SlideTimerTick(null, null);
//Setup timer for next slide request
myTimer.Stop();
myTimer.Interval = 5000;
myTimer.Start();
}



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.