title: VLC.DotNet Control Hosted in WPF
body: <p>I have hosted the <a href="http://vlcdotnet.codeplex.com/" rel="nofollow">VLC.DotNet</a> windows Control in a <code>WindowsFormsHost</code> element, inside a WPF window. The reason behind doing this, instead of using Vlc.DotNet WPF control is because the performance of the WinForms version is twice better than the WPF version.</p>
  
  <p>Anyway, everything works fine, except for one annoying detail; When using the WinForms version inside a <strong>WinForms App</strong>, the rendered video <strong>will exactly fit the control</strong>; However, using the same control inside a <code>WindowsFormsHost</code> element, causes the video to be rendered as it's original size and not fitted to the control.</p>
  
  <p>There are 2 things to notice here :</p>
  
  <ol>
  <li><p>The WinForms control is exactly the same, so in my opinion, this behavior could not be related to it.</p></li>
  <li><p>Using <strong>Spy++</strong> I've managed to see when the control is used inside a WinForms App, the rectangle of the rendered video is exactly the same size as the rectangle of the Control itself, But when used in WPF App, the recatngle of the video (which is rendered by VLC and I have no control on it) is not the same size as the control. Instead, it has the same size as the video itself.</p></li>
  </ol>
  
  <p>Anyone has any particular ideas on why WPF is showing this strange behavior?</p>
  
  <p>Any suggestions would be appreciated. </p>
  
  <p>Thanks a lot folks.</p>