Exemplo n.º 1
0
        public Form1()
        {
            //

            InitializeComponent();
            p = new Pen((Color)Settings.Default["Color"]);
            p.DashStyle = (DashStyle)Settings.Default["DashStyle"];

            scale.Minimum = Convert.ToDecimal(0.5);
            scale.Maximum = 2;
            scale.Increment = Convert.ToDecimal(0.1);
            scale.Value = Convert.ToDecimal(0.5);

            label3.Text = "y = f(x)";
            secondFunctionBox.Hide();
            label4.Hide();
            groupBox1.Size = new Size(333, 57);

            Bitmap chosenColor = new Bitmap(10, 10);
            Graphics fill = Graphics.FromImage(chosenColor);
            SolidBrush brush = new SolidBrush(p.Color);
            fill.FillRectangle(brush, 0, 0, ColorButton.Width, ColorButton.Height);
            ColorButton.Image = chosenColor;
            fill.Dispose();
            statusDash.Text = "Solid";
            ChangeButton.Enabled = false;

            Draft = new Bitmap(sheet.Width, sheet.Height);
            builder = new Builder(Draft, pixelcoeff * Convert.ToSingle(scale.Value));
            builder.BuildNet();
            builder.BuildAxes();
            builder.BuildSection();
            builder.BuildCoordinates();
            Image = Draft;
        }
Exemplo n.º 2
0
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            Functions.Clear();
            RPN_Box.ResetText();
            ChangeButton.Enabled = false;
            FunctionList.Items.Clear();

            builder = new Builder(Draft, pixelcoeff * Convert.ToSingle(scale.Value));
            builder.Clear();
            builder.BuildNet();
            builder.BuildAxes();
            builder.BuildSection();
            builder.BuildCoordinates();
        }
Exemplo n.º 3
0
        private void scale_ValueChanged(object sender, EventArgs e)
        {
            Draft = new Bitmap(sheet.Width, sheet.Height);
            builder = new Builder(Draft, pixelcoeff * Convert.ToSingle(scale.Value));
            builder.Clear();
            builder.BuildNet();
            builder.BuildAxes();
            builder.BuildSection();
            builder.BuildCoordinates();
            Image = Draft;

            if (Functions.Count != 0)
            {
                foreach (Function function in Functions)
                {
                    Pen pen = new Pen(function.color, 2);
                    pen.DashStyle = function.LineStyle;
                    builder.DrawFunction(function);
                }
            }
            else
            {
                ;
            }
        }