WaitOneUpdateAll() public method

public WaitOneUpdateAll ( Generator node ) : void
node Generator
return void
示例#1
0
文件: Program.cs 项目: nemesit/OpenNI
        static void Run()
        {
            string SAMPLE_XML_FILE = @"../../../../Data/SamplesConfig.xml";

            Context context = new Context(SAMPLE_XML_FILE);

            DepthGenerator depth = context.FindExistingNode(NodeType.Depth) as DepthGenerator;
            if (depth == null)
            {
                Console.WriteLine("Sample must have a depth generator!");
                return;
            }

            MapOutputMode mapMode = depth.MapOutputMode;

            DepthMetaData depthMD = new DepthMetaData();

            Console.WriteLine("Press any key to stop...");

            while (!Console.KeyAvailable)
            {
                context.WaitOneUpdateAll(depth);

                depth.GetMetaData(depthMD);

                Console.WriteLine("Frame {0} Middle point is: {1}.", depthMD.FrameID, depthMD[(int)mapMode.XRes/2, (int)mapMode.YRes/2]);
            }
        }