コード例 #1
0
        static public Bitmap GetView(Size area, Complex center, Complex[] values, GraphicsRoundContext context)
        {
            var logger = new Logger("GetView1.txt");//log

            var bitmapChart = new Bitmap(area.Width, area.Height);
            //var scale = opts.ScalePercents / 100;
            var size = Math.Min(area.Width /* scale*/, area.Height /** scale*/);
            var gr   = Graphics.FromImage(bitmapChart);

            gr.SmoothingMode     = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear;

            gr.Clear(Color.White);

            gr.DrawEllipse(new Pen(context.RoundColor, context.RoundThickness),
                           new Rectangle(0, 0, size, size));

            var points = values.Select(v => GetAbsoluteCoords(v, size)).ToArray();

            //for (var i = 0; i < points.Length; i++)
            //{
            //    DrawPoint(gr, points[i], context.PointsRadius, context.PointsColor,
            //              String.Format("{0:0.###}", values[i].Magnitude));
            //}

            gr.DrawCurve(new Pen(context.LineColor, context.LineThickness), points);

            DrawPoint(gr, GetAbsoluteCoords(center, size), context.CenterRadius, context.CenterColor,
                      center.Magnitude.ToString());

            return(bitmapChart);
        }
コード例 #2
0
        public GraphicsContextModel()
        {
            contexts = new Dictionary <ISignal, GraphicsSignalContext>();

            RoundView  = new GraphicsRoundContext();
            LinearView = new GraphicsLinearContext();
        }
コード例 #3
0
 public SpectrumViewContext(Spectrum spectrum, ISignal signal, GraphicsRoundContext round, GraphicsLinearContext linear)
 {
     Transformed    = spectrum;
     Origin         = signal;
     RoundGraphics  = round;
     LinearGraphics = linear;
 }