Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var endOfRec = DateTime.Now.Add(TimeSpan.FromSeconds(30));
            using (var writer = new AviWriter("test.avi")
            {
                FramesPerSecond = 15,
                EmitIndex1 = true
            })
            {
                var stream = writer.AddVideoStream();

                stream.Width = Screen.PrimaryScreen.WorkingArea.Width;
                stream.Height = Screen.PrimaryScreen.WorkingArea.Height;
                stream.Codec = KnownFourCCs.Codecs.Uncompressed;
                stream.BitsPerPixel = BitsPerPixel.Bpp32;

                var googleChrome = new TestCase();

                Task.Factory.StartNew(() =>
                {
                    googleChrome.Scenario("http://www.google.com", "что посмотреть сегодня?");
                });

                var buffer = new byte[Screen.PrimaryScreen.WorkingArea.Width * Screen.PrimaryScreen.WorkingArea.Height * 4];
                while (!TestCase.isFinished)
                {
                    GetScreenshot(buffer);
                    stream.WriteFrame(true, buffer, 0, buffer.Length);
                }
            }

            Console.WriteLine("Execution Done");
        }