Windows phone 8 使用'录制视频文件;缩略图';Windows phone 8中的图像

Windows phone 8 使用'录制视频文件;缩略图';Windows phone 8中的图像,windows-phone-8,Windows Phone 8,我正在尝试在WindowsPhone8中创建带有“缩略图”图像的视频捕获应用程序商店视频文件。我从以下链接得到一些提示: . 但结果是相当恼人的。我觉得这个功能有点问题 void captureSource_CaptureImageCompleted(object sender, CaptureImageCompletedEventArgs e) { using (IsolatedStorageFile isoStore = IsolatedStorag

我正在尝试在WindowsPhone8中创建带有“缩略图”图像的视频捕获应用程序商店视频文件。我从以下链接得到一些提示: . 但结果是相当恼人的。我觉得这个功能有点问题

 void captureSource_CaptureImageCompleted(object sender, CaptureImageCompletedEventArgs e)
        {
            using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication())
            {
                WriteableBitmap wb = e.Result;
                string fileName = "CameraMovie.jpg";
                if (isoStore.FileExists(fileName))
                    isoStore.DeleteFile(fileName);
                IsolatedStorageFileStream file = isoStore.CreateFile(fileName);
                Extensions.SaveJpeg(wb, file, wb.PixelWidth, wb.PixelHeight, 0, 85);
                file.Close();

                captureSource.Stop();
                fileSink.CaptureSource = null;
                fileSink.IsolatedStorageFileName = null;
            }
        }
e、 结果中有一些无效数据。当我将其绑定到图像控件时,它会显示一些恼人的图像。
任何人都可以帮助我。

[EDIT]添加一些解释

录制视频时,可以在任何点获取正在录制的视频的快照。将预览缓冲区获取为Argb像素,并将其应用于可写位图

当您必须显示视频时,请在屏幕截图图像上添加一个覆盖层,另一个图像上有一个光滑的播放按钮

var videoWritableBitmap = new WriteableBitmap((int)[AudioVideoDevice].PreviewResolution.Width, (int)[AudioVideoDevice].PreviewResolution.Height);

var argbPixels = new int[(int)[AudioVideoDevice].PreviewResolution.Width * (int)[AudioVideoDevice].PreviewResolution.Height];

[AudioVideoDevice].GetPreviewBufferArgb(argbPixels);

argbPixels.CopyTo(videoWritableBitmap.Pixels, 0);

var videoThumbNailFile = await[localFolder].OpenStreamForWriteAsync([ThumbNailImageName], CreationCollisionOption.ReplaceExisting);

videoWritableBitmap.SaveJpeg(videoThumbNailFile, videoWritableBitmap.PixelWidth, videoWritableBitmap.PixelHeight, 0, 100);

请在答案中添加说明