Ho to take a snapshot from the "VideoCaptureElement"

Nov 16, 2011 at 4:34 PM

I ma using VideoCaptureElement to show live vdeo frim selected camera .....

Can I take a snapshot from this live video as bitmap or any this

 

Dec 5, 2011 at 4:36 PM

I had a lot of trouble with the event that was supposed to actually fire every time a frame was captured. It just never got there, even going through the code of the WPFMediaKit.

Basically, I just took a snapshop of the actual visual element.

 RenderTargetBitmap bmp = new RenderTargetBitmap(1280, 720, 96, 96, PixelFormats.Pbgra32);
 bmp.Render(videoCapElement);

And that "videoCapElement" is my item from XAML

<WPFMediaKit:VideoCaptureElement x:Name="videoCapElement"
                                 LoadedBehavior="Manual"
                                 DesiredPixelWidth="1280"
                                 DesiredPixelHeight="720"
                                 OutputFileName="Media\\Temp.wmv"  
                                 Stretch="Fill"
                                 VideoCaptureSource="{Binding Path=CaptureDeviceName}" 
                                 FPS="30" 
                                 EnableSampleGrabbing="True"
                                 NewVideoSample="videoCapElement_NewVideoSample" />