Exemplo n.º 1
0
        private void SensorSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            bool received = false;

            using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame())
            {
                if (skeletonFrame != null)
                {
                    skeletonFrame.CopySkeletonDataTo(this.skeletonData);
                    received = true;
                }
            }

            if (received)
            {
                // 重绘整个画面,冲掉原有骨骼图像
                skeletonImage.Draw(new Rectangle(0, 0, skeletonImage.Width, skeletonImage.Height), new Bgr(0.0, 0.0, 0.0), -1);

                DrawSkeletons(skeletonImage, 0);
                imageBox1.Image = skeletonImage;


                FlushClient fc = new FlushClient(ShowIn12Label);//多线程
                fc.BeginInvoke(null, null);
            }
        }
Exemplo n.º 2
0
        private void WaitForStatus(string lastSN)
        {
            FlushClient fc = new FlushClient(RunStatus);

            fc.BeginInvoke(lastSN, null, null);
            //  fc.BeginInvoke(lastSN, GetResult, null);
            //  Thread getStatusThread = new Thread(new ParameterizedThreadStart(RunStatus));
            //    getStatusThread.Start(lastSN);
            waitResultEvent.WaitOne();
            if (getStatusResult)
            {
                this.labMessage.Text = "状态获取成功";
            }
            else
            {
                ReloadData();
                this.labMessage.Text = "状态获取失败";
            }
            tbNo.Text = "";
            tbNo.Focus();
            Application.DoEvents();
        }
Exemplo n.º 3
0
 private void CrossThreadFlush(object WorkFunc)
 {
     Control.CheckForIllegalCrossThreadCalls = false;
     FlushClient WorkingThreadFunc = (FlushClient)WorkFunc;
     FlushClient fc = new FlushClient(WorkingThreadFunc);
     fc.BeginInvoke(null,null);
     //this.BeginInvoke(fc);
 }
Exemplo n.º 4
0
 private void CrossThreadFlush()
 {
     FlushClient fc = new FlushClient(ThreadStartCheckFunction);
     fc.BeginInvoke(null, null);
 }