/// <summary> /// Capture a lot of bitmaps and convert them to video. /// </summary> /// <param name="region"></param> public async void CaptureVideo(Rectangle region) { MemoryStream stream; var toast = -1; // Create a new toast which closing event gonna stop the recording toast = ToastService.Create(Resources.StopRecording, Color.OrangeRed, 0, () => { toast = ToastService.Create(Resources.Encoding, 0); CaptureService.StopRecording(); }); stream = await CaptureService.RecordVideo(region, Config.VideoExt, SettingsService.Current.SafeVideoFps); ToastService.Remove(toast); // Generate filename and start the upload(s) var url = await UploadAll(stream, Config.VideoExt); stream.Dispose(); CopyUrl(url); Complete(url != null); // Exits the application }