Esempio n. 1
0
        private void CreateAntvideo()
        {
            if (writer != null)
            {
                FinalizeAntVideo();
            }

            stream = new MemoryStream();
            writer = new AntVideoWriter(stream);
            control.Invoke((MethodInvoker)(() =>
            {
                control.Recording = true;
                control.RecordedFrame = 0;
            }));
        }
Esempio n. 2
0
        private void FinalizeAntVideo()
        {
            if (writer != null)
            {
                writer.Close();
                writer = null;
                if (lastFrame != null)
                {
                    string player = string.Join(", ", lastFrame.ColonyStates.Select(c => c.ColonyName + " (" + c.Points.ToString() + ")"));
                    control.Invoke((MethodInvoker)(() =>
                    {
                        control.Add(stream, player);
                    }));
                }
                stream = null;

                control.Invoke((MethodInvoker)(() =>
                {
                    control.Recording = false;
                    control.RecordedFrame = 0;
                }));
            }
        }