protected virtual bool Paint()
        {
            if (_MFVideoDisplayControl != null)
            {
                _MFVideoDisplayControl.RepaintVideo();
            }
            else
            {
                GDI.PAINTSTRUCT ps;
                IntPtr          hDC = GDI.BeginPaint(_hwnd, out ps);

                if (_VMRWindowlessControl != null)
                {
                    _VMRWindowlessControl.RepaintVideo(_hwnd, hDC);
                }
                else if (_VMRWindowlessControl9 != null)
                {
                    _VMRWindowlessControl9.RepaintVideo(_hwnd, hDC);
                }

                GDI.EndPaint(_hwnd, ref ps);
            }

            return(true);
        }
Esempio n. 2
0
 private void PaintHandler(object sender, PaintEventArgs e)
 {
     if (_videoRender != null)
     {
         IntPtr hdc = e.Graphics.GetHdc();
         _vmrWindowlessControl.RepaintVideo(_hostControl.Handle, hdc);
         e.Graphics.ReleaseHdc(hdc);
     }
 }
Esempio n. 3
0
 private void PaintHandler(object sender, PaintEventArgs e)
 {
     Log("PaintHandler");
     try
     {
         lock (instanceMutex)
         {
             if (_windowlessControl != null)
             {
                 Graphics hostControlGraphics = _hostControl.CreateGraphics();
                 IntPtr   hdc = hostControlGraphics.GetHdc();
                 _windowlessControl.RepaintVideo(_hostControl.Handle, hdc);
                 hostControlGraphics.ReleaseHdc(hdc);
             }
         }
     }
     catch (Exception exc)
     {
         ErrorLogger.DumpToDebug(exc);
     }
 }