我尝试使用以下代码从正在运行的视频中删除照片或停止使用MediaElement。
没有错误,但没有照片显示,也没有照片被抓取并保存在Photo Hub中。什么似乎是问题?非常感谢你的帮助。
WriteableBitmap wb = new WriteableBitmap(mediaElement1,null);
wb.Invalidate();
wb.Render(mediaElement1, new TranslateTransform());
MemoryStream msWrite = new MemoryStream();
System.Windows.Media.Imaging.Extensions.SaveJpeg(wb, msWrite, 640, 480, 0, 100);
msWrite.Seek(0, SeekOrigin.Begin);
MediaLibrary ML = new MediaLibrary();
ML.SavePicture("test" + ".jpg", msWrite);
//-- Display the capture image from mediaElement
image1.Source = wb;
WriteableBitmap wb = new WriteableBitmap(mediaElement1,null);
wb.Invalidate();
wb.Render(mediaElement1, new TranslateTransform());
MemoryStream msWrite = new MemoryStream();
System.Windows.Media.Imaging.Extensions.SaveJpeg(wb, msWrite, 640, 480, 0, 100);
msWrite.Seek(0, SeekOrigin.Begin);
MediaLibrary ML = new MediaLibrary();
ML.SavePicture("test" + ".jpg", msWrite);
//-- Display the capture image from mediaElement
image1.Source = wb;
答案 0 :(得分:0)