private async void openMenuItem_Click(object sender, EventArgs e) { var filePath = string.Empty; using (var ofd = new OpenFileDialog()) { // ofd.InitialDirectory = "c:\\"; ofd.Filter = "Video files (*.mp4;*.avi)|*.mp4;*.avi"; ofd.FilterIndex = 1; ofd.RestoreDirectory = true; if (ofd.ShowDialog() == DialogResult.OK) { videoFilepath = ofd.FileName; if (!database.HasAnalysis(videoFilepath)) { aw.FilePath = videoFilepath; aw.ShowDialog(); database.Store(videoFilepath, aw.OutputAnalysisFilepath); } analysisInfo = await database.Get(videoFilepath); VideoplayerLoad(); VideoplayerStart(); } } }
public ReportWindow(string reportFilepath, string videoFilepath, AnalysisInfo analysisInfo) { InitializeComponent(); this.reportFilepath = reportFilepath; rg = new ReportGenerator(videoFilepath, analysisInfo); }
public ReportGenerator(string videoFilepath, AnalysisInfo analysisInfo) { this.videoFilepath = videoFilepath; analysis = analysisInfo; random = new Random(); headerFont = new Font("Open Sans", 48, FontStyle.Bold); pieFont = new Font("Open Sans", 18, FontStyle.Regular); titleFont = new Font("Open Sans", 24, FontStyle.Regular); piePen = new Pen(Color.White, 3); titlePen = new Pen(Color.FromArgb(147, 126, 243), 4); borderPen = new Pen(Color.FromArgb(150, 224, 218), 5); backgroundBrush = new SolidBrush(Color.FromArgb(17, 17, 17)); textBrush = new SolidBrush(Color.FromArgb(255, 255, 255)); niceBrushes = new List <Brush>(); niceBrushes.Add(new SolidBrush(Color.FromArgb(14, 105, 16))); niceBrushes.Add(new SolidBrush(Color.FromArgb(255, 67, 0))); niceBrushes.Add(new SolidBrush(Color.FromArgb(101, 21, 127))); niceBrushes.Add(new SolidBrush(Color.FromArgb(255, 189, 0))); niceBrushes.Add(new SolidBrush(Color.FromArgb(255, 0, 81))); niceBrushes.Add(new SolidBrush(Color.FromArgb(143, 155, 249))); niceBrushes.Add(new SolidBrush(Color.FromArgb(191, 118, 210))); niceBrushes.Add(new SolidBrush(Color.FromArgb(194, 75, 79))); niceBrushes.Add(new SolidBrush(Color.FromArgb(102, 104, 191))); }
public void Load(string videoFilepath, AnalysisInfo analysisInfo) { this.analysisInfo = analysisInfo; reader.Open(videoFilepath); VideoWidth = reader.Width; VideoHeight = reader.Height; Framerate = reader.FrameRate.Value; videoLoaded = true; currentFrame = 0; frameCount = reader.FrameCount; CalculateFrameRectangle(); }