private unsafe void fnThread() { while (FRunning) { this.FContext.context.WaitOneUpdateAll(this.FDepthGenerator); byte *rgbs = (byte *)FImageGenerator.ImageMapPtr.ToPointer(); byte *rgbd = (byte *)FImageRGBBuffer.MIplImage.imageData.ToPointer(); for (int i = 0; i < 640 * 480; i++) { rgbd[2] = rgbs[0]; rgbd[1] = rgbs[1]; rgbd[0] = rgbs[2]; rgbs += 3; rgbd += 3; } //CopyMemory(FImageRGBBuffer.MIplImage.imageData, FImageGenerator.ImageMapPtr, 640 * 480 * 3); CopyMemory(FImageDepthBuffer.MIplImage.imageData, FDepthGenerator.DepthMapPtr, 640 * 480 * 2); fillWorld(); FImageRGB.SetImage(FImageRGBBuffer); FImageDepth.SetImage(FImageDepthBuffer); FImageWorld.SetImage(FImageWorldBuffer); } }