public 光谱仪Tab(Form1 form, TabControl tabCtrl, string [] 多个文件名) { foreach (string 文件名 in 多个文件名) { 海洋红外光谱数据 数据 = new 海洋红外光谱数据(文件名); if (数据.画曲线图(图宽, 图高, Color.Black)) { 光谱数据表.Add(数据); } } if (光谱数据表.Count > 0) { int 每行图片数 = 1900 / 图宽; for (int i = 0; i < 光谱数据表.Count; i++) { 曲线图片框 图片框 = new 曲线图片框(new Point((i % 每行图片数) * (图宽 + 2), (图高 + 2) * (i / 每行图片数)), 光谱数据表[i]); Controls.Add(图片框); } 主窗体 = form; Text = "海洋红外谱线" + 光谱数据表.Count + "个"; AutoScroll = true; tabCtrl.TabPages.Insert(0, this); tabCtrl.SelectedTab = this; 所属tabControl = tabCtrl; } }
public 曲线图片框(Point 位置, 海洋红外光谱数据 数据) { Size = new Size(数据.数据曲线图.Width, 数据.数据曲线图.Height); Location = 位置; 谱数据 = 数据; Image = 谱数据.数据曲线图; MouseMove += 曲线图片框_MouseMove; }
public void 关闭() { 谱数据.关闭(); 谱数据 = null; Dispose(); }