OpenNI.Context.WaitAndUpdateAll C# (CSharp) Method

WaitAndUpdateAll() public method

public WaitAndUpdateAll ( ) : void
return void
        public void WaitAndUpdateAll()
        {
            int status = SafeNativeMethods.xnWaitAndUpdateAll(this.InternalObject);
            WrapperUtils.ThrowOnError(status);
        }

Usage Example

コード例 #1
0
        private void InitOpenNI()
        {
            // ContextとImageGeneratorの作成
            ScriptNode node;
            context = Context.CreateFromXmlFile( "SamplesConfig.xml", out node );
            context.GlobalMirror = false;
            image = context.FindExistingNode( NodeType.Image ) as ImageGenerator;

            // 画像更新のためのスレッドを作成
            shouldRun = true;
            readerThread = new Thread( new ThreadStart( () =>
            {
                while ( shouldRun ) {
                    context.WaitAndUpdateAll();
                    ImageMetaData imageMD = image.GetMetaData();

                    // ImageMetaDataをBitmapSourceに変換する(unsafeにしなくてもOK!!)
                    this.Dispatcher.BeginInvoke( DispatcherPriority.Background, new Action( () =>
                    {
                        imageOpenNI.Source = BitmapSource.Create( imageMD.XRes, imageMD.YRes,
                            96, 96, PixelFormats.Rgb24, null, imageMD.ImageMapPtr,
                            imageMD.DataSize, imageMD.XRes * imageMD.BytesPerPixel );
                    } ) );
                }
            } ) );
            readerThread.Start();
        }
All Usage Examples Of OpenNI.Context::WaitAndUpdateAll