private void SetupWindow(RS.PipelineProfile pipelineProfile, out Action <RS.VideoFrame> color, out Action <RS.VideoFrame> depth) { using (var p = pipelineProfile.GetStream(RS.Stream.Depth).As <RS.VideoStreamProfile>()) img_Depth.Source = new WriteableBitmap(p.Width, p.Height, 96d, 96d, PixelFormats.Rgb24, null); depth = UpdateImage(img_Depth); using (var p = pipelineProfile.GetStream(RS.Stream.Color).As <RS.VideoStreamProfile>()) img_Main.Source = new WriteableBitmap(p.Width, p.Height, 96d, 96d, PixelFormats.Rgb24, null); color = UpdateImage(img_Main); }
private void SetupWindow(PipelineProfile pipelineProfile, out Action <VideoFrame> depth, out Action <VideoFrame> color) { try { using (var p = pipelineProfile.GetStream(Stream.Depth).As <VideoStreamProfile>()) imgDepth.Source = new WriteableBitmap(p.Width, p.Height, 96d, 96d, PixelFormats.Rgb24, null); } catch (Exception ex) { MessageBox.Show("Unable to find Deapth Stream. " + ex.Message); } depth = UpdateImage(imgDepth); try { using (var p = pipelineProfile.GetStream(Stream.Color).As <VideoStreamProfile>()) imgColor.Source = new WriteableBitmap(p.Width, p.Height, 96d, 96d, PixelFormats.Rgb24, null); } catch (Exception ex) { MessageBox.Show("Unable to find Color Stream. " + ex.Message); } color = UpdateImage(imgColor); }