コード例 #1
0
        public void EndRecord()
        {
            if (!IsRecording) return;

            // End the process.
             m_aviWriter.End();

            // Clear the memory
            m_WindowToImageFilter.Dispose();
            m_WindowToImageFilter = null;

            m_aviWriter.Dispose();
            m_aviWriter = null;

            FilePath = null;
        }
コード例 #2
0
        public void StartRecord()
        {
            // If already started, return directly.
            if (IsRecording) return;

            // Check the file path
            if (string.IsNullOrEmpty(FilePath)) throw new ArgumentNullException(/*MSG0*/"FilePath is not set!");

            // Initialize the window to image filter and AVI writer
            m_WindowToImageFilter = new vtk.vtkWindowToImageFilter();
            m_WindowToImageFilter.SetInput(IApp.theApp.RenderWindow);

            m_aviWriter = new vtk.vtkAVIWriter();
            m_aviWriter.SetInputConnection(m_WindowToImageFilter.GetOutputPort());
            m_aviWriter.SetFileName(FilePath);

            // Start record
            m_aviWriter.Start();
        }