コード例 #1
0
        public static void TestRaceDataOverlay()
        {
            var leaderboard = new LeaderBoard
            {
                OverlayData = BuildData()
            };

            for (var i = 24.5; i < 300.0; i += 5.0 / 59.9)
            {
                using( var bitmap = (Bitmap)Bitmap.FromFile(@"c:\users\dean\documents\image.bmp") )
                    using (var g = Graphics.FromImage(bitmap))
                    {
                        Console.WriteLine("time is {0}", i);
                        leaderboard.Overlay(g, i.FromSecondsToNano());
                        g.Flush();
                        try
                        {
                            bitmap.Save(@"c:\users\dean\documents\newimage.bmp");
                        }
                        catch
                        {

                        }
                    }

                Thread.Sleep(10);
            }
        }
コード例 #2
0
        private static void TestOutroOverlay()
        {
            var leaderboard = new LeaderBoard
            {
                OverlayData = BuildData()
            };

            int i = 1;
            using (var bitmap = (Bitmap)Bitmap.FromFile(@"c:\users\dean\documents\image.bmp"))
            using (var g = Graphics.FromImage(bitmap))
            {
                Console.WriteLine("time is {0}", i);
                leaderboard.Outro(g, i.FromSecondsToNano());
                g.Flush();
                bitmap.Save(@"c:\users\dean\documents\newimage.bmp");
            }
        }
コード例 #3
0
        public static void Apply(string gameDataFile, int videoBitRate, string destFile, bool highlights, Action<long, long> progressReporter, Func<bool> isAborted, string pluginName)
        {
            try
            {
                var leaderBoard = new LeaderBoard { OverlayData = OverlayData.FromFile(gameDataFile), PluginName = pluginName };

                var transcoder = new Transcoder
                {
                    VideoFiles = leaderBoard.OverlayData.VideoFiles.ToSourceReaderExtra(),
                    DestinationFile = destFile,
                    VideoBitRate = videoBitRate
                };

                new TranscodeAndOverlay(leaderBoard, progressReporter).Process(transcoder, highlights, progressReporter, isAborted);
            }
            catch (Exception e)
            {
                TraceError.WriteLine(e.Message);
                TraceError.WriteLine(e.StackTrace);
                throw e;
            }
        }
コード例 #4
0
 private TranscodeAndOverlay(LeaderBoard leaderBoard, Action<long, long> progressReporter)
 {
     this.leaderBoard = leaderBoard;
     this.progressReporter = progressReporter;
 }
コード例 #5
0
        public static void Apply(string gameDataFile, int videoBitRate, int audioBitRate, string destFile, bool highlights, Action<long, long> progressReporter)
        {
            var leaderBoard = new LeaderBoard { OverlayData = OverlayData.FromFile(gameDataFile) };

            var transcoder = new Transcoder
            {
                VideoFiles = leaderBoard.OverlayData.VideoFiles.ToSourceReaderExtra(),
                DestinationFile = destFile,
                VideoBitRate = videoBitRate,
                AudioBitRate = audioBitRate
            };

            new TranscodeAndOverlay(leaderBoard, progressReporter)._Apply(transcoder, highlights, progressReporter);
        }