c# - Saving current frame of video-Windows Store app -
i have scenario pick video library , save frame image on clicking button. can capture current frame of video playing in wpf.
i had done in windows phone 8-
writeablebitmap bmpcurrentscreenimage = new writeablebitmap((int)media.actualwidth, (int)media.actualheight); bmpcurrentscreenimage.render(media, new matrixtransform()); bmpcurrentscreenimage.invalidate(); try { using (var stream = new memorystream()) { bmpcurrentscreenimage.savejpeg(stream, bmpcurrentscreenimage.pixelwidth, bmpcurrentscreenimage.pixelheight, 0, 100); stream.seek(0, seekorigin.begin); bitmapimage bi = new bitmapimage(); bi.setsource(stream); img.source = bi; } } catch (exception exp) { } but in windows store app writablebitmap class has no such function savejpeg() used writeablebitmaprenderextensions toolkit- writeablebitmap w = await writeablebitmaprenderextensions.render(mymedia); w.invalidate(); thumb.source = w; not working media element only.
on goggling found post similar mine this post can't understand how can use since in c++ , creating app c#.
you can use emgu cv frame work live capturing , working on video file.here link official page of emgu community explaining example.
Comments
Post a Comment