Exemplo n.º 1
0
 private void pictureBox1_Paint(object sender, PaintEventArgs e)
 {
     if (panelmode == "graph")
     {
         List <MyPoint> points = new List <MyPoint>();
         string         input  = ScreenBox.Text;
         PreProcess(ref input);
         e.Graphics.DrawImageUnscaled(GraphArithmetic.GetPlot(input, cx, cx + 352, cy + 224, cy, plotmultiplier, plotside), 0, 0);
     }
 }
Exemplo n.º 2
0
        private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {
            Bitmap IMAGE = GraphArithmetic.GetPlot("", cx, cx + pictureBox1.Width, cy, cy - pictureBox1.Height, plotmultiplier, plotside);

            RefreshList();
            foreach (var item in Plots)
            {
                GraphArithmetic.DrawPlot(IMAGE, item.Value.Points, cx, cx + pictureBox1.Width, cy, cy - pictureBox1.Height, plotmultiplier, plotside);
            }
            e.Graphics.DrawImageUnscaled(IMAGE, 0, 0);
        }
Exemplo n.º 3
0
        private void RefreshList()
        {
            int    plotseparate = 15;
            double plotmult     = plotseparate * plotmultiplier;

            if (plotmult == 0)
            {
                plotmult = plotseparate;
            }

            checkedListBox1.Items.Clear();
            foreach (var item in Plots)
            {
                Plots[item.Key].Points = GraphArithmetic.GetPoints(item.Key, cx / plotmult, (cx + pictureBox1.Width) / plotmult, 0.5 / plotmultiplier);
                checkedListBox1.Items.Add(item.Key);
            }
        }
Exemplo n.º 4
0
        public void AddPlot(string expression)
        {
            if (Plots == null)
            {
                Plots = new Dictionary <string, PlotParams>();
            }

            if (Plots.Count > 16)
            {
                MessageBox.Show("Нельзя добавлять больше 16 графиков", "Невозможно добавить график", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (expression != "")
                {
                    Plots[expression] = new PlotParams(GraphArithmetic.GetPoints(expression, cx, cx + pictureBox1.Width), Color.AliceBlue);
                }
            }

            RefreshList();
            pictureBox1.Invalidate();
        }