문제

I've built a simple form that can play a video using functionality from the direct show library. The video plays in a panel in a UserControl that is housed in a pretty simple form. I'm wondering if there's any way for the video to scale it's size along with the form. I've tried anchoring the control in the form (using the dock) and setting the auto re size to true. I feel like there should be some simple solution but it's not coming to me. I understand this is very general but I would greatly appreciate any sort of help along with whether or not this is possible.

도움이 되었습니까?

해결책

You need to update video position along with form resizes (IVMRWindowlessControl9.SetVideoPosition and similar). DirectShow.NET samples do it:

\Samples\VMR9\BitmapMixer\MainForm.cs:

private void MainForm_ResizeMove(object sender, EventArgs e)
{
    if (windowlessCtrl != null)
    {
        int hr = windowlessCtrl.SetVideoPosition(null,
           DsRect.FromRectangle(this.ClientRectangle));
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top