Example #1
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            if (System.IO.File.Exists(textBox1.Text))
            {
                Cursor.Current = Cursors.WaitCursor;
                button1.Enabled = false;

                if (cam != null)
                {
                    cam.Dispose();
                    cam = null;
                }

                if (cam == null)
                {
                    cam = new Capture(textBox1.Text, textBox2.Text, panel1,true,null);

                    mediaEvent = cam.MediaEventEx;
                    int hr = mediaEvent.SetNotifyWindow(this.Handle, WM_GRAPHNOTIFY, IntPtr.Zero);

                    cam.Start();
                }
            }
        }
        protected void setupVideo()
        {
            mCubeSceneNode = mSceneManager.RootSceneNode.CreateChildSceneNode("CubeNode",
                new Vector3(0f, 0f, 0f));
            // Create knot objects so we can see movement
            //            mCubeEntity = mSceneManager.CreateEntity("CubeShape", SceneManager.PrefabType.PT_CUBE);
            mCubeEntity = mSceneManager.CreateEntity("CubeShape", SceneManager.PrefabType.PT_PLANE);
            mCubeSceneNode.AttachObject(mCubeEntity);
            mCubeSceneNode.Scale(1.5f, 1.5f, 1.5f);

            mvideoWidth = 1024;
            mvideoHeight = 768;

            setTextureDimensions(false);

            setupVideoGraphicsObject();

            Thread lRenderVideoThread = new Thread(new ThreadStart(renderVideoThread));
            lRenderVideoThread.Start();

            cam = new Capture(Configuration.getConfiguration().TrainingVideoFile, "Test String", mParentWindow, false, new VideoUserOptions(),null);
            cam.VideoBufferReceivedEvent += new Capture.OnVideoBufferReceivedEvent(OnVideoBufferReceivedEvent);
            cam.Start();
        }
 public DirectShowVideoWrapper(string videoPath, Panel videoOwnerPanel, Panel stepsOwnerPanel, VideoUserOptions pVideoUserOptions)
 {
     cam = new Capture(videoPath, "Test String", videoOwnerPanel, true, pVideoUserOptions);
     m_StepsOwnerPanel = stepsOwnerPanel;
     cam.FrameMilestoneEvent += new Capture.OnFrameMilestoneEvent(OnFrameMilestoneEvent);
 }