How to capture a frame during playback

Feb 18, 2011 at 3:21 PM
Edited Feb 18, 2011 at 3:22 PM

Hi,

is there a way to capture a frame from the playbacked video?

 

Thanks and regards,

Daniele

Feb 18, 2011 at 5:41 PM

Yes and no. You can render the mediaelement into a WritableBitmap . You can show the image within silverlight but you will not be able to save the image outside of silverlight. You will get an error about security. Basically if you create an image in Silverlight from any control that was showing content that is from another site (or even another protocol) it will not be allowed. The rules around this are extremely draconian and made me have to turn down a few projects and suggest they use Flash instead.

Feb 21, 2011 at 7:30 AM

Thank you for your answer, I could capture the image and upload it to my back-end...

Thank you very much,
Daniele

Feb 21, 2011 at 11:57 AM

I done it using WritableBitmapEx to retrieve the byte array of the image from the MediaElement (as you suggested to me) and ImageTools (only two dlls, ImageTools.dll and ImageTools.IO.Jpeg.dll) to encode it in JPEG, now I can send the jpeg to the back-end via POST. It works very good and it is lite!!

Regards,

Daniele