title: How to use CapturedFrame to render a web cam video preview while recording using WinRT MediaCapture in WPF Desktop app
body: <p>There are plenty of developers that are frustrated by the fact that the MediaCapture class is available to use in WPF, however, the CaptureElement used to preview the video recording is not.</p>
  
  <p>I understand this limitation, however, I want to use the MediaCapture class to record video.. and I'd like to find a way to provide a preview in WPF if it's possible.</p>
  
  <p>After a lot of digging online, I ran across the CapturedFrame class.  It appears that the CapturedFrame is an abstraction that represents a single frame of video recorded from the MediaCapture object.  </p>
  
  <p>CapturedFrame MSDN:</p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/windows.media.capture.capturedframe.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/windows/desktop/windows.media.capture.capturedframe.aspx</a></p>
  
  <p>The CapturedFrame class has a property SoftwareBitmap ..</p>
  
  <p>My question:</p>
  
  <p>Can anyone provide some code or a link which may demonstrate how you could perhaps record a video to a file from MediaCapture.. while processing each frame to some how grab the Bitamp to show the bitmap in WPF with an image control?</p>
  
  <p>I understand that this is not the most effective way to handle the problem, however, if it's possible and it does work, this should be a viable work around for all of us WPF desktop devs that can't use the CaptureElement.</p>
  
  <p>I would like to say that I am aware of WPFMediaKit and other open source projects, however, if this is possible, it's the way that I wish to proceed.</p>
  
  <p>Thanks in advance to any replies.</p>