private void DrawCurve(IGraphDrawer Drawer) { PointD[] pout; //Drawing Brightness Curve if (ProjectManager.CurrentProject.Frames.Count > 0 && ProjectManager.CurrentProject.IsBrightnessCalculated) { Drawer.SetCurveLinePen(); List <PointD> BrP = new List <PointD>(); for (int i = 0; i < ProjectManager.CurrentProject.Frames.Count; i++) { BrP.Add(new PointD(i, (float)ProjectManager.CurrentProject.Frames[i].AlternativeBrightness)); } pout = this.RealToGraph(BrP); for (int i = 1; i < pout.Length; i++) { Drawer.DrawLine((float)pout[i - 1].X, (float)pout[i - 1].Y, (float)pout[i].X, (float)pout[i].Y); } } if (this.Points.Count > 0 && ProjectManager.CurrentProject.IsBrightnessCalculated) { //Drawing Custom Curve Drawer.SetCustomCurveLinePen(); pout = this.RealToGraph(Interpolation.Do(this.Points.ToArray(), BrightnessGraph.Smoothness)); for (int i = 1; i < pout.Length; i++) { Drawer.DrawLine((float)pout[i - 1].X, (float)pout[i - 1].Y, (float)pout[i].X, (float)pout[i].Y); } //Drawing Points Drawer.SetPointPen(); for (int i = 0; i < this.Points.Count; i++) { PointD tmp = this.RealToGraph(this.Points[i]); Drawer.DrawCircle((float)tmp.X - PointRadius, (float)tmp.Y - PointRadius, PointRadius * 2); } //Drawing Selected Point Drawer.SetSelectedPointPen(); PointD tmpSel = this.RealToGraph(this.Points[this.SelectedPoint]); Drawer.DrawCircle((float)tmpSel.X - PointRadius, (float)tmpSel.Y - PointRadius, PointRadius * 2); } }
private void DrawScale(IGraphDrawer Drawer) { Drawer.SetBaseLinePen(); //draw Y axe Drawer.DrawLine(Left, Top, Left, this.Height - Bottom); Drawer.DrawLine(this.Width - Right, Top, this.Width - Right, this.Height - Bottom + GridWidth); //draw X axe Drawer.DrawLine(Left, this.Height - Bottom, this.Width - Right, this.Height - Bottom); Drawer.DrawLine(Left - GridWidth, Top, this.Width - Right, Top); double Xs = (this.Width - Left - Right) / 10d; double Ys = (this.Height - Top - Bottom) / 10d; //draw X and Y scales for (int i = 1; i < 10; i++) { //Y scale Drawer.DrawLine(Left - GridWidth, (float)(this.Height - Bottom - i * Ys), this.Width - Right, (float)(this.Height - Bottom - i * Ys)); //X scale Drawer.DrawLine((float)(Left + i * Xs), Top, (float)(Left + i * Xs), this.Height - Bottom + GridWidth); } }
private void DrawCurve(IGraphDrawer Drawer) { PointD[] pout; //Drawing Brightness Curve if (ProjectManager.CurrentProject.Frames.Count > 0 && ProjectManager.CurrentProject.IsBrightnessCalculated) { Drawer.SetCurveLinePen(); List<PointD> BrP = new List<PointD>(); for (int i = 0; i < ProjectManager.CurrentProject.Frames.Count; i++) { BrP.Add(new PointD(i, (float)ProjectManager.CurrentProject.Frames[i].AlternativeBrightness)); } pout = this.RealToGraph(BrP); for (int i = 1; i < pout.Length; i++) Drawer.DrawLine((float)pout[i - 1].X, (float)pout[i - 1].Y, (float)pout[i].X, (float)pout[i].Y); } if (this.Points.Count > 0 && ProjectManager.CurrentProject.IsBrightnessCalculated) { //Drawing Custom Curve Drawer.SetCustomCurveLinePen(); pout = this.RealToGraph(Interpolation.Do(this.Points.ToArray(), BrightnessGraph.Smoothness)); for (int i = 1; i < pout.Length; i++) Drawer.DrawLine((float)pout[i - 1].X, (float)pout[i - 1].Y, (float)pout[i].X, (float)pout[i].Y); //Drawing Points Drawer.SetPointPen(); for (int i = 0; i < this.Points.Count; i++) { PointD tmp = this.RealToGraph(this.Points[i]); Drawer.DrawCircle((float)tmp.X - PointRadius, (float)tmp.Y - PointRadius, PointRadius * 2); } //Drawing Selected Point Drawer.SetSelectedPointPen(); PointD tmpSel = this.RealToGraph(this.Points[this.SelectedPoint]); Drawer.DrawCircle((float)tmpSel.X - PointRadius, (float)tmpSel.Y - PointRadius, PointRadius * 2); } }