public void InitializeBodyIndexStream() { // open the reader for the depth frames this.bodyIndexFrameReader = this.kinectSensor.BodyIndexFrameSource.OpenReader(); bodyIHandler = BodyIndexHandler.Instance; bodyIHandler.BodyIndexHandlerSet(this.kinectSensor.BodyIndexFrameSource.FrameDescription); // create the bitmap to display this.bodyIndexBitmap = new WriteableBitmap(bodyIHandler.Width, bodyIHandler.Height, 96.0, 96.0, PixelFormats.Bgr32, null); }
public PreviewWindow() { InitializeComponent(); ch = ColorHandler.Instance; ch.openReader(); bh = BodyIndexHandler.Instance; bh.openReader(); dh = DepthHandler.Instance; dh.startReading(); ih = InfraredHandler.Instance; ih.startReading(); sh = SkeletonHandler.Instance; sh.openReader(); depthPreviewBitmap = new WriteableBitmap(dh.Width, dh.Height, 96.0, 96.0, PixelFormats.Gray16, null); infraredPreviewBitmap = new WriteableBitmap(ih.Width, ih.Height, 96.0, 96.0, PixelFormats.Gray16, null); ComponentDispatcher.ThreadIdle += new System.EventHandler(ComponentDispatcher_ThreadIdle); }