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); } }
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"); } }
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; } }
private TranscodeAndOverlay(LeaderBoard leaderBoard, Action<long, long> progressReporter) { this.leaderBoard = leaderBoard; this.progressReporter = progressReporter; }
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); }