Beispiel #1
0
        private void importToolStripMenuItem_Click(object sender, EventArgs e)
        {//数据导入
            try
            {
                this.ImportFDL.Filter = "csv文件(*.csv)|*.csv"; //导入csv数据文件
                if (ImportFDL.ShowDialog() == DialogResult.OK)
                {
                    //读取文件
                    StreamReader import_file = new StreamReader(this.ImportFDL.FileName);

                    //清屏,绘图,刷新
                    Graphics g = this.pictureBox1.CreateGraphics();
                    Funcs.Importfile(import_file, g, this.pictureBox1.Height, this.pictureBox1.Width);
                    Funcs.Maximum();
                    Funcs.Scale(this.pictureBox1.Width, this.pictureBox1.Height);
                    this.pictureBox1.Refresh();

                    //关闭文件
                    import_file.Close();
                }//if
            }
            catch
            {
                MessageBox.Show("数据中只有一点或格式错误");
            }
        }
Beispiel #2
0
 private void pictureBox1_SizeChanged(object sender, EventArgs e)
 {
     //刷新,激活重绘
     if (first_change > 2)
     {
         Graphics g = this.pictureBox1.CreateGraphics();
         MyGlo.scale = 999999999999999;
         Funcs.Scale(this.pictureBox1.Width, this.pictureBox1.Height);
         this.pictureBox1.Refresh();
     }
     else
     {
         first_change += 1;
     }
 }