示例#1
0
        protected override void OnClick()
        {
            IRasterLayer rasterLayer = Painter.ActiveLayer;

            RasterFileDialog saveFileDialog = new RasterFileDialog(FileDialogType.Save);
            saveFileDialog.InitialDirectory = Path.GetDirectoryName(rasterLayer.FilePath);
            saveFileDialog.InitialFileName = Path.GetFileNameWithoutExtension(rasterLayer.FilePath) + "_edited";

            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                Painter.SaveEditsAs(saveFileDialog.FileName);

                Display.ClearElement(Painter.Paints.GetAllGraphicElements());
                Painter.Paints.Clear();
            }

            try
            {

            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
            }
        }
示例#2
0
        /// <summary>
        /// Prompts the user to a file dialog and select the input raster file.
        /// </summary>
        private void openInputRasterBbutton_Click(object sender, EventArgs e)
        {
            RasterFileDialog openFileDialog = new RasterFileDialog(FileDialogType.Open);
            openFileDialog.Multiselect = false;

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    inputRasterComboBox.Text = openFileDialog.FileName;
                    editLayer = new RasterLayerClass();
                    editLayer.CreateFromFilePath(openFileDialog.FileName);
                    ShowExtent(editLayer);

                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
                    inputRasterComboBox.Text = "";
                    editLayer = null;
                }
            }

            this.BringToFront();
        }
示例#3
0
        /// <summary>
        /// Open a file dialog and select the output raster file.
        /// </summary>
        private void openOutputRasterButton_Click(object sender, EventArgs e)
        {
            RasterFileDialog openFileDialog = new RasterFileDialog(FileDialogType.Save);

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                outputRasterTextBox.Text = openFileDialog.FileName;
            }

            this.BringToFront();
        }
示例#4
0
        /// <summary>
        /// Open a file dialog and select the output raster file.
        /// </summary>
        private void openOutputRasterButton_Click(object sender, EventArgs e)
        {
            RasterFileDialog openFileDialog = new RasterFileDialog(FileDialogType.Save);

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                outputRasterTextBox.Text = openFileDialog.FileName;
            }

            this.BringToFront();
        }
示例#5
0
        /// <summary>
        /// Opens a file dialog and select the reference raster file.
        /// </summary>
        private void openOutputExtentButton_Click(object sender, EventArgs e)
        {
            RasterFileDialog openFileDialog = new RasterFileDialog(FileDialogType.Open);
            openFileDialog.Multiselect = false;

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                outputExtentComboBox.Text = openFileDialog.FileName;

                try
                {
                    IRasterLayer rasterLayer = new RasterLayerClass();
                    rasterLayer.CreateFromFilePath(openFileDialog.FileName);
                    ShowExtent(rasterLayer);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
                    outputExtentComboBox.Text = "";
                }
            }

            this.BringToFront();
        }