Items with no label
3338 Discussions

C# How to show RGB and Depth streams on Forms Picturebox

SMath17
Beginner
3,207 Views

Hi, I am looking at the sample here:

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/csharp/cs-tutorial-2-capture/Window.xaml.cs

 

This sample shows the RGB and depth stream on "Image" in WPF. But my application is using windows forms. How can I show this same thing on 2 "PictureBox"?

I think I need to update this part of code. I am also kind of new to C# and just learning it. thanks

 

private void SetupWindow(PipelineProfile pipelineProfile, out Action<VideoFrame> depth, out Action<VideoFrame> color) { using (var p = pipelineProfile.GetStream(Stream.Depth) as VideoStreamProfile) imgDepth.Source = new WriteableBitmap(p.Width, p.Height, 96d, 96d, PixelFormats.Rgb24, null); depth = UpdateImage(imgDepth);   using (var p = pipelineProfile.GetStream(Stream.Color) as VideoStreamProfile) imgColor.Source = new WriteableBitmap(p.Width, p.Height, 96d, 96d, PixelFormats.Rgb24, null); color = UpdateImage(imgColor); }

 

0 Kudos
1 Reply
MartyG
Honored Contributor III
2,809 Views

There was a very similar case to yours during the past week on the RealSense GitHub site by a user called 'jinxzzz'.

 

https://github.com/IntelRealSense/librealsense/issues/3413

 

That case is still open and the Intel staff there will be aware of it, so if you require further help if the information posted there already does not solve your problem, I recommend adding a further comment to that GitHub discussion.

0 Kudos
Reply