As the last code we will define the VideoFrameReady

Description of your first forum.
Post Reply
sujonkumar6300
Posts: 316
Joined: Thu Jan 16, 2025 8:32 am

As the last code we will define the VideoFrameReady

Post by sujonkumar6300 »

and DepthFrameReady methods that handle the reception of the video and the depth respectively. The content of both methods is very similar, with very slight variations.

We start by creating a variable of type PlanarImage and assigning it the value of the ImageFrame.Image attribute of our argument, which always has the image that the camera is taking at that moment. Then we define a variable of type BitmapSource whose value is built from the corresponding stream, passing it as parameters, the width, the height, the DPI of each Bangladesh Mobile Database image (by default they are 96), the format of its pixels in which the difference is that one is RGB or BGR32 for the video and for depth I will give a 16-bit gray color palette or Gray16, then the bits in memory from the image variable. Finally, in each method the BitmapSource that we defined is assigned, as the value of the attribute of the image control that we defined at the beginning, videoImage for the video control and depthImage for the depth control.




Our code is ready, now we just run the application by pressing F5 and we will be able to see on our screen the signal captured by the Kinect.

The screenshot of the image generated by the depth sensor is not included here because the tones are very dark and cannot be distinguished in the printed magazine, but I invite you to try it, it is quite simple.

The code used in this article is available at This code is practically the minimum essential preset by Microsoft to start working with the Kinect.
Post Reply