Exemple #1
0
        /// <summary>
        /// 读取待转文件信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            OpenFileDialog OFD = new OpenFileDialog();

            OFD.Filter = null;

            if (OFD.ShowDialog() == DialogResult.OK)
            {
                string Path = OFD.FileName;
                readHdrPath = Path + ".hdr";
                rd          = new read();
                rd.HDRread(readHdrPath);
                rd.Dataread(Path);
                textEdit2.Text = Path;
            }
        }
        /// <summary>
        /// 打开新文件作为数据传入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button3_Click(object sender, EventArgs e)
        {
            /// </summary>
            /// 新文件文件读取
            /// </summary>
            string          dataPath = ""; string hdrPath = "";
            Imagestatistics imagsta = new Imagestatistics();
            OpenFileDialog  ofd     = new OpenFileDialog();

            ofd.Filter = null;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                dataPath = ofd.FileName;
                hdrPath  = ofd.FileName + ".hdr";
            }
            read rd = new read();

            rd.HDRread(hdrPath);
            /// </summary>
            /// imagsta实例窗体数据初始化和赋值
            /// </summary>
            imagsta.LineCounts   = rd.LineCounts;
            imagsta.ColumnCounts = rd.ColumnCounts;
            imagsta.bands        = rd.bands;
            //imagsta.DataType = rd.DataType;
            imagsta.Interleave = rd.Interleave;
            imagsta.BandsData  = new int[imagsta.bands, imagsta.ColumnCounts *imagsta.LineCounts];
            imagsta.BandsDataD = new double[imagsta.bands, imagsta.ColumnCounts *imagsta.LineCounts];
            //Form1.abl.readmore.Add(rd);

            if (rd.Dataread(dataPath) == true)
            {
                MessageBox.Show("选择成功!");
            }
            imagsta.BandsData  = rd.BandsData;
            imagsta.BandsDataD = rd.BandsDataD;
            imagsta.Show();

            this.Close();
        }
Exemple #3
0
        private void OpenFile_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            OpenFileDialog OFD = new OpenFileDialog();

            OFD.Filter = null;

            if (OFD.ShowDialog() == DialogResult.OK)
            {
                /// <summary>
                /// 数据读取
                /// <summary>
                DataPath = OFD.FileName;
                string hdrPATH = DataPath + ".hdr";
                read   rd      = new read();
                rd.HDRread(hdrPATH);
                rd.Dataread(DataPath);
                /// <summary>
                /// 添加至数据流中
                readmore.Add(rd);
                boduan.Add(rd);
                this.BandsData = rd.BandsData;
                abl.readmore.Add(rd);

                /// <summary>
                /// 数据标识传递
                /// <summary>
                abl.PATH = DataPath;
                /// <summary>
                /// Form_Load方法添加新树节点
                abl.Form_Load(sender, e);
                /// <summary>
                /// show
                /// <summary>
                abl.Show();
            }
        }