コード例 #1
0
        private void message_form_Load(object sender, EventArgs e)
        {
            Form1   f    = Application.OpenForms["Form1"] as Form1;
            formgcp form = Application.OpenForms["formgcp"] as formgcp;

            this.Owner = f;
            if (formgcp.Form_active == true)
            {
                this.Owner = form;
            }
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form1 f1 = new Form1();

            f1.view_main_defult();
            formgcp fgcp = new formgcp();

            fgcp.view_gcp_defult();
            GeoTransform geo = new GeoTransform();

            geo.view_defualt();

            appy_view();
        }
コード例 #3
0
        private void processbarform_Load(object sender, EventArgs e)
        {
            this.BackColor       = Color.White;
            this.TransparencyKey = Color.White;

            Form1        f     = Application.OpenForms["Form1"] as Form1;
            formgcp      form  = Application.OpenForms["formgcp"] as formgcp;
            GeoTransform trans = Application.OpenForms["GeoTransform"] as GeoTransform;

            this.Owner = f;
            if (formgcp.Form_active == true)
            {
                this.Owner = form;
            }
            if (GeoTransform.form_active == true)
            {
                this.Owner = trans;
            }
        }
コード例 #4
0
        private void points_view_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (Form1.Image_ID > -1)
            {
                Form1 f_main = Application.OpenForms["Form1"] as Form1;
                f_main.GCP_draw(Form1.gcp_collected[Form1.Image_ID]);
                f_main.GCP_draw(Form1.gcp_collected[Form1.Image_ID]);
            }

            if (formgcp.Form_active == true)
            {
                formgcp f_gcp = Application.OpenForms["formgcp"] as formgcp;
                f_gcp.dzy_main();
            }
            if (GeoTransform.form_active == true)
            {
                GeoTransform geo = Application.OpenForms["GeoTransform"] as GeoTransform;
                geo.image_dzyn();
            }
        }
コード例 #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            //GCP & ICP Collection window
            formgcp.datatable_back_color = Color.FromName(ımageComboBox8.SelectedItem.ToString());
            formgcp.line_select_color    = Color.FromName(ımageComboBox9.SelectedItem.ToString());
            formgcp.img_select_color     = Color.FromName(ımageComboBox11.SelectedItem.ToString());

            formgcp.imgbox_backcolor = Color.FromName(ımageComboBox15.SelectedItem.ToString());
            formgcp.title_font_name  = ımageComboBox7.SelectedItem.ToString();
            formgcp.values_font_name = ımageComboBox10.SelectedItem.ToString();
            formgcp.title_font_size  = (int)numericUpDown7.Value;
            formgcp.values_font_size = (int)numericUpDown8.Value;
            formgcp.decimal_points   = (int)numericUpDown10.Value;

            //main windom
            Form1.select_point_color = Color.FromName(ımageComboBox13.SelectedItem.ToString());
            Form1.mouse_icon_color   = Color.FromName(ımageComboBox14.SelectedItem.ToString());

            //gcp in main windom
            Form1.gcp_font_name = ımageComboBox1.SelectedItem.ToString();
            Form1.gcp_text_size = (float)numericUpDown1.Value;
            Color clr;

            clr = Color.FromName(ımageComboBox2.SelectedItem.ToString());
            Form1.gcp_text_color  = clr;
            Form1.gcp_line_length = (float)numericUpDown2.Value;
            Form1.gcp_line_width  = (float)numericUpDown3.Value;
            clr = Color.FromName(ımageComboBox3.SelectedItem.ToString());
            Form1.gcp_line_color = clr;
            Form1.gcp_type_name  = checkBox1.Checked;
            Form1.gcp_id_name    = checkBox2.Checked;

            //icp in main windom
            Form1.icp_font_name = ımageComboBox4.SelectedItem.ToString();
            Form1.icp_text_size = (float)numericUpDown6.Value;
            clr = Color.FromName(ımageComboBox5.SelectedItem.ToString());
            Form1.icp_text_color  = clr;
            Form1.icp_line_length = (float)numericUpDown5.Value;
            Form1.icp_line_width  = (float)numericUpDown4.Value;
            clr = Color.FromName(ımageComboBox6.SelectedItem.ToString());
            Form1.icp_line_color = clr;
            Form1.icp_type_name  = checkBox4.Checked;
            Form1.icp_id_name    = checkBox3.Checked;

            // view GeoTransform
            GeoTransform.vektor_back   = Color.FromName(ımageComboBox12.SelectedItem.ToString());
            GeoTransform.vektor_canves = Color.FromName(ımageComboBox16.SelectedItem.ToString());
            GeoTransform.wind_back     = Color.FromName(ımageComboBox17.SelectedItem.ToString());
            GeoTransform.vektor_color  = Color.FromName(ımageComboBox18.SelectedItem.ToString());
            GeoTransform.wind_canves   = Color.FromName(ımageComboBox19.SelectedItem.ToString());
            GeoTransform.wind_color    = Color.FromName(ımageComboBox20.SelectedItem.ToString());
            GeoTransform.date_back     = Color.FromName(ımageComboBox23.SelectedItem.ToString());

            GeoTransform.title_font_name  = ımageComboBox21.SelectedItem.ToString();
            GeoTransform.values_font_name = ımageComboBox24.SelectedItem.ToString();

            GeoTransform.title_font_size  = (int)numericUpDown11.Value;
            GeoTransform.values_font_size = (int)numericUpDown9.Value;
            GeoTransform.decimal_points   = (int)numericUpDown12.Value;

            //////
            Form1 f1 = new Form1();

            f1.view_save();
            formgcp fgcp = new formgcp();

            fgcp.view_save();
            GeoTransform geo = new GeoTransform();

            geo.view_save();
            this.Close();
        }
コード例 #6
0
        /// <summary>
        /// this method is for opening or changing the image.
        /// </summary>
        /// <param name="href_open">image filename</param>
        /// <param name="empty">true=no image / false=have image</param>
        /// <param name="new_img">true= new image / false= change image</param>
        public void open_Image(string href_open, bool empty, bool new_img)
        {
            try
            {
                OpenFileDialog opendio = new OpenFileDialog();
                opendio.FileName = href_open;
                href_open        = opendio.SafeFileName;
                Form1  form = Application.OpenForms["Form1"] as Form1;
                int    bit = 0, channels = 0;
                string format = null;
                if (empty != true)
                {
                    imginfo(opendio.FileName, out bit, out channels, out format);
                }
                form.ımageBox1.Image = null;
                form.ımageBox2.Image = null;
                Bitmap mini_bmp = null;
                if (new_img == true)
                {
                    Form1.Image_ID = form.treeView1.Nodes[Form1.Project_ID].Nodes.Count;
                    Array.Resize <int>(ref Form1.main_width, Form1.main_width.Length + 1);
                    Array.Resize <int>(ref Form1.main_height, Form1.main_height.Length + 1);
                    Form1.gcp_count = 0;
                    Form1.icp_count = 0;
                }
                if (empty == true)
                {
                    if (new_img == true)
                    {
                        Form1.main_width[Form1.Image_ID]  = Empty_image.emp_Width;
                        Form1.main_height[Form1.Image_ID] = Empty_image.emp_Height;
                    }

                    Image <Rgb, byte> main_Image = main_Image = new Image <Rgb, byte>(Form1.main_width[Form1.Image_ID],
                                                                                      Form1.main_height[Form1.Image_ID], new Rgb(Empty_image.empty_page_clr));
                    form.ımageBox1.Image = main_Image;
                    Form1.Main_Bants     = main_Image.Split();
                    mini_bmp             = new Bitmap(main_Image.Bitmap);
                    opendio.FileName     = "empty";
                }
                else
                {
                    if (bit == 16)
                    {
                        if (channels >= 3)
                        {
                            Image <Gray, ushort>[] bit_bants_16 = bantsimg_16(opendio.FileName);
                            Form1.Main_Bants = new Image <Gray, Byte> [channels];
                            int i;
                            for (i = 0; i < channels; i++)
                            {
                                Form1.Main_Bants[i] = bit_bants_16[i].Convert <Gray, byte>();
                            }
                            Image <Gray, byte>[] rgb        = { Form1.Main_Bants[0], Form1.Main_Bants[1], Form1.Main_Bants[2] };
                            Image <Rgb, byte>    main_Image = new Image <Rgb, byte>(rgb);
                            form.ımageBox1.Image = main_Image;
                            mini_bmp             = new Bitmap(main_Image.Bitmap);
                        }
                        if (channels < 3)
                        {
                            Image <Gray, ushort>[] bit_bants_16 = bantsimg_16(opendio.FileName);
                            Form1.Main_Bants = new Image <Gray, Byte> [channels];
                            int i;
                            for (i = 0; i < channels; i++)
                            {
                                Form1.Main_Bants[i] = bit_bants_16[i].Convert <Gray, byte>();
                            }
                            form.ımageBox1.Image = Form1.Main_Bants[0];
                            mini_bmp             = new Bitmap(Form1.Main_Bants[0].Bitmap);
                        }
                    }
                    if (bit == 8)
                    {
                        if (channels >= 3)
                        {
                            Form1.Main_Bants = bantsimg_8(opendio.FileName);
                            Image <Gray, byte>[] rgb        = { Form1.Main_Bants[0], Form1.Main_Bants[1], Form1.Main_Bants[2] };
                            Image <Rgb, byte>    main_Image = new Image <Rgb, byte>(rgb);
                            form.ımageBox1.Image = main_Image;
                            mini_bmp             = new Bitmap(main_Image.Bitmap);
                        }
                        if (channels < 3)
                        {
                            Form1.Main_Bants     = bantsimg_8(opendio.FileName);
                            form.ımageBox1.Image = Form1.Main_Bants[0];
                            mini_bmp             = new Bitmap(Form1.Main_Bants[0].Bitmap);
                        }
                    }
                }
                if (new_img == true)
                {
                    Form1.bants_img_count.Add(channels);
                    treenodes_add_img(href_open, channels, true);
                    form.treeView1.SelectedNode = form.treeView1.Nodes[Form1.Project_ID].Nodes[Form1.Image_ID];
                    Form1.Imagelist.Add(opendio.FileName);
                }
                Form1.main_width[Form1.Image_ID]  = Form1.Main_Bants[0].Width;
                Form1.main_height[Form1.Image_ID] = Form1.Main_Bants[0].Height;
                form.decrease(mini_bmp);
                Form1.zoom     = 1;
                Form1.cnt_zoom = 0;
                form.follow_window();
                form.ımageBox1.HorizontalScrollBar.Value = 0;
                form.ımageBox1.VerticalScrollBar.Value   = 0;
                form.zoom_in(new Point(0, 0));
                form.zoom_out(new Point(0, 0));
                form.radioButton1.Checked = true;
                Form1.Save_Control        = 1;
                Button_control();
                if (formgcp.Form_active == true)
                {
                    formgcp ff = Application.OpenForms["formgcp"] as formgcp;
                    ff.dzy_main();
                }
            }
            catch (Exception mistake)
            {
                MessageBox.Show(mistake.Message.ToString());
            }
        }