private Video videoClip = null;
public void PlayMovie()
{
// First try to open this as a video file
videoClip = new Video("video.mpg");
videoClip.Size.Height.Equals(640); //movie height
videoClip.Size.Width.Equals(480); //movie width
// the sample uses a form but I have just a window formed by DX
videoClip.Owner = this.sampleFramework.Window; //build error
// Start playing now
videoClip.Play();
}
DirectX.AudioVideoPlayback / video.Owner
I have found a media player in one of the managed DX samples. Im trying to modify it to play the movie inside my game window, but the Owner method says it requires System.Windows.Forms.Control object and I just need to use this.sampleFramework.Window.... any ideas?
exact error Cannot implicitly convert type 'System.IntPtr' to 'System.Windows.Forms.Control'
Have you tried using the FromHandle or FromChildHandle mehtods of Control? I don't know much about the sample framework, but if they call it a window and the type is IntPtr than than the IntPtr is probably a HWIND and you can get a Control from it like so:
It should also work with a form instead of a control.
Hope this helps.
Control.FromHandle(this.sampleFramework.Window);
It should also work with a form instead of a control.
Hope this helps.
yeah it compiles now hehe, but when the movie plays it makes a new window for every frame lol, atleast now I can figure out something.
thanx
thanx
lol I know why it was playing over and over in the onframerender lol, i just limited it to one time only now... works good... the size remains the same though for some reason (not 640x480)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement