问题描述
在新的SDK中,骨架视图示例使用Microsoft.Samples.Kinect.WpfViewers来显示深度和RGB数据。这与前面的例子中的bitmapsource有什么区别?使用任何一个时,性能是否有差异?
另外,在项目中使用它的正确方法是什么?到目前为止,我已经采用了以下方法,但我并不确定imageHelper的功能是什么。谢谢,
In the new SDK the skeleton view example uses Microsoft.Samples.Kinect.WpfViewers to display depth and RGB data. What is the difference between that and bitmapsource from the previous examples? Is there a difference in performance when using either one? Also, what is the proper way to use it in a project? So far I've resorted to the following, but I'm not exactly sure that the function of imageHelper is. Thank you,
image_Kinect = e.ImageFrame.Image;
image_Kinect = e.ImageFrame.Image;
if(imageHelper = = null)
if (imageHelper == null)
{
imageHelper = new InteropBitmapHelper(image_Kinect.Width,image_Kinect.Height,image_Kinect.Bits);
imageHelper = new InteropBitmapHelper(image_Kinect.Width, image_Kinect.Height, image_Kinect.Bits);
im_kinect.Source = imageHelper.InteropBitmap;
im_kinect.Source = imageHelper.InteropBitmap;
}
else
{
imageHelper.UpdateBits(image_Kinect.Bits);
imageHelper.UpdateBits(image_Kinect.Bits);
im_kinect.Source = imageHelper.InteropBitmap;
im_kinect.Source = imageHelper.InteropBitmap;
}
推荐答案
;       // interopBitmap是一个WPF结构,可以重置图像的位。
//这比每帧执行一次BitmapSource.Create调用更有效。
因此它只是一种从PlanarImage到ImageSource的更有效方式。
//An interopBitmap is a WPF construct that enables resetting the Bits of the image.
//This is more efficient than doing a BitmapSource.Create call every frame.
so it's just a more efficient way of going from a PlanarImage to an ImageSource.
这篇关于用于Kinect深度视图和WPF的InteropBitmaps。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!