Sign in to follow this  
anvil

DirectX.AudioVideoPlayback / video.Owner

Recommended Posts

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'

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();
}


Share this post


Link to post
Share on other sites
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:
Control.FromHandle(this.sampleFramework.Window);

It should also work with a form instead of a control.

Hope this helps.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this