I am using DirectShow.NET library [ http://directshownet.sourceforge.net/ ] and I use below code in order to show video streams.
videowindow.put_Owner(handle);
videowindow.put_WindowStyle(WindowStyle.Child | WindowStyle.ClipChildren);
videowindow.put_WindowState(DirectShowLib.WindowState.Show);
Note: The handle is System.Windows.Forms.UserControl handle [ this->Handle]
The problem is that:
- In my user control the video frames are not shown properly: I see half of the video frame and the other half is out of screen.
- Also when I scale my user control, the video stream frames are not scaled.
What may cause this ? How can i fix it?
Update:
Based on Roman Answer I added following code:
videoWindow.SetWindowPosition(this.ClientRectangle.Left,
this.ClientRectangle.Top,
this.ClientRectangle.Width,
this.ClientRectangle.Height);
And Now I can able to see video frame in my user control rectangle properly....