Beispiel #1
0
        private void imgInfoBtn_Click(object sender, EventArgs e)
        {
            ImportImageForm form = new ImportImageForm();

            form.SetImage(selectBgDlg.FileName);
            form.e = RiverSimulationProfile.profile.sourceE;
            form.n = RiverSimulationProfile.profile.sourceN;
            form.w = RiverSimulationProfile.profile.sourceW;
            form.h = RiverSimulationProfile.profile.sourceH;
            if (DialogResult.OK == form.ShowDialog())
            {
                imgInfoBtn.Enabled = true;
                RiverSimulationProfile.profile.SetImportImage(selectBgDlg.FileName, form.e, form.n, form.w, form.h);
                mapPicBox.SetMapBackground(selectBgDlg.FileName, form.e, form.n, form.w, form.h);
                SwitchPreivewCombo(PreviewType.GridMap);
                UpdateStatus();
            }
        }
Beispiel #2
0
        private void selectBgBtn_Click(object sender, EventArgs e)
        {
            DialogResult result = selectBgDlg.ShowDialog(); // Show the dialog.

            if (result == DialogResult.OK)                  // Test result.
            {
                selectBgFilePath.Text = selectBgDlg.FileName;
                ImportImageForm form = new ImportImageForm();
                form.SetImage(selectBgDlg.FileName);
                if (form.HasJgw() || DialogResult.OK == form.ShowDialog())
                {
                    imgInfoBtn.Enabled = true;
                    RiverSimulationProfile.profile.SetImportImage(selectBgDlg.FileName, form.e, form.n, form.w, form.h);
                    mapPicBox.SetMapBackground(selectBgDlg.FileName, form.e, form.n, form.w, form.h);
                    SwitchPreivewCombo(PreviewType.GridMap);
                    UpdateStatus();
                }
                else
                {
                    selectBgFilePath.Text = "";
                }
            }
        }
Beispiel #3
0
        private void selectBgBtn_Click(object sender, EventArgs e)
        {
            DialogResult result = selectBgDlg.ShowDialog(); // Show the dialog.
            if (result == DialogResult.OK) // Test result.
            {
                selectBgFilePath.Text = selectBgDlg.FileName;
                ImportImageForm form = new ImportImageForm();
                form.SetImage(selectBgDlg.FileName);
                if (DialogResult.OK == form.ShowDialog())
                {
                    imgInfoBtn.Enabled = true;
                    RiverSimulationProfile.profile.SetImportImage(selectBgDlg.FileName, form.e, form.n, form.w, form.h);
                    mapPicBox.SetMapBackground(selectBgDlg.FileName, form.e, form.n, form.w, form.h);
                    SwitchPreivewCombo(PreviewType.GridMap);
                    UpdateStatus();
                }
                else
                {
                    selectBgFilePath.Text = "";

                }

            }
        }
Beispiel #4
0
 private void imgInfoBtn_Click(object sender, EventArgs e)
 {
     ImportImageForm form = new ImportImageForm();
     form.SetImage(selectBgDlg.FileName);
     form.e = RiverSimulationProfile.profile.sourceE;
     form.n = RiverSimulationProfile.profile.sourceN;
     form.w = RiverSimulationProfile.profile.sourceW;
     form.h = RiverSimulationProfile.profile.sourceH;
     if (DialogResult.OK == form.ShowDialog())
     {
         imgInfoBtn.Enabled = true;
         RiverSimulationProfile.profile.SetImportImage(selectBgDlg.FileName, form.e, form.n, form.w, form.h);
         mapPicBox.SetMapBackground(selectBgDlg.FileName, form.e, form.n, form.w, form.h);
         SwitchPreivewCombo(PreviewType.GridMap);
         UpdateStatus();
     }
 }